@@ -887,25 +887,33 @@ LogicalIncreaseRestartDecodingForSlot(XLogRecPtr current_lsn, XLogRecPtr restart
887
887
{
888
888
slot -> candidate_restart_valid = current_lsn ;
889
889
slot -> candidate_restart_lsn = restart_lsn ;
890
+ SpinLockRelease (& slot -> mutex );
890
891
891
892
elog (DEBUG1 , "got new restart lsn %X/%X at %X/%X" ,
892
893
(uint32 ) (restart_lsn >> 32 ), (uint32 ) restart_lsn ,
893
894
(uint32 ) (current_lsn >> 32 ), (uint32 ) current_lsn );
894
895
}
895
896
else
896
897
{
898
+ XLogRecPtr candidate_restart_lsn ;
899
+ XLogRecPtr candidate_restart_valid ;
900
+ XLogRecPtr confirmed_flush ;
901
+
902
+ candidate_restart_lsn = slot -> candidate_restart_lsn ;
903
+ candidate_restart_valid = slot -> candidate_restart_valid ;
904
+ confirmed_flush = slot -> data .confirmed_flush ;
905
+ SpinLockRelease (& slot -> mutex );
906
+
897
907
elog (DEBUG1 , "failed to increase restart lsn: proposed %X/%X, after %X/%X, current candidate %X/%X, current after %X/%X, flushed up to %X/%X" ,
898
908
(uint32 ) (restart_lsn >> 32 ), (uint32 ) restart_lsn ,
899
909
(uint32 ) (current_lsn >> 32 ), (uint32 ) current_lsn ,
900
- (uint32 ) (slot -> candidate_restart_lsn >> 32 ),
901
- (uint32 ) slot -> candidate_restart_lsn ,
902
- (uint32 ) (slot -> candidate_restart_valid >> 32 ),
903
- (uint32 ) slot -> candidate_restart_valid ,
904
- (uint32 ) (slot -> data .confirmed_flush >> 32 ),
905
- (uint32 ) slot -> data .confirmed_flush
906
- );
910
+ (uint32 ) (candidate_restart_lsn >> 32 ),
911
+ (uint32 ) candidate_restart_lsn ,
912
+ (uint32 ) (candidate_restart_valid >> 32 ),
913
+ (uint32 ) candidate_restart_valid ,
914
+ (uint32 ) (confirmed_flush >> 32 ),
915
+ (uint32 ) confirmed_flush );
907
916
}
908
- SpinLockRelease (& slot -> mutex );
909
917
910
918
/* candidates are already valid with the current flush position, apply */
911
919
if (updated_lsn )
0 commit comments