@@ -962,25 +962,33 @@ LogicalIncreaseRestartDecodingForSlot(XLogRecPtr current_lsn, XLogRecPtr restart
962
962
{
963
963
slot -> candidate_restart_valid = current_lsn ;
964
964
slot -> candidate_restart_lsn = restart_lsn ;
965
+ SpinLockRelease (& slot -> mutex );
965
966
966
967
elog (DEBUG1 , "got new restart lsn %X/%X at %X/%X" ,
967
968
(uint32 ) (restart_lsn >> 32 ), (uint32 ) restart_lsn ,
968
969
(uint32 ) (current_lsn >> 32 ), (uint32 ) current_lsn );
969
970
}
970
971
else
971
972
{
973
+ XLogRecPtr candidate_restart_lsn ;
974
+ XLogRecPtr candidate_restart_valid ;
975
+ XLogRecPtr confirmed_flush ;
976
+
977
+ candidate_restart_lsn = slot -> candidate_restart_lsn ;
978
+ candidate_restart_valid = slot -> candidate_restart_valid ;
979
+ confirmed_flush = slot -> data .confirmed_flush ;
980
+ SpinLockRelease (& slot -> mutex );
981
+
972
982
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" ,
973
983
(uint32 ) (restart_lsn >> 32 ), (uint32 ) restart_lsn ,
974
984
(uint32 ) (current_lsn >> 32 ), (uint32 ) current_lsn ,
975
- (uint32 ) (slot -> candidate_restart_lsn >> 32 ),
976
- (uint32 ) slot -> candidate_restart_lsn ,
977
- (uint32 ) (slot -> candidate_restart_valid >> 32 ),
978
- (uint32 ) slot -> candidate_restart_valid ,
979
- (uint32 ) (slot -> data .confirmed_flush >> 32 ),
980
- (uint32 ) slot -> data .confirmed_flush
981
- );
985
+ (uint32 ) (candidate_restart_lsn >> 32 ),
986
+ (uint32 ) candidate_restart_lsn ,
987
+ (uint32 ) (candidate_restart_valid >> 32 ),
988
+ (uint32 ) candidate_restart_valid ,
989
+ (uint32 ) (confirmed_flush >> 32 ),
990
+ (uint32 ) confirmed_flush );
982
991
}
983
- SpinLockRelease (& slot -> mutex );
984
992
985
993
/* candidates are already valid with the current flush position, apply */
986
994
if (updated_lsn )
0 commit comments