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