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