@@ -1783,9 +1783,9 @@ RecvAppendResponses(Safekeeper *sk)
1783
1783
return sk -> state == SS_ACTIVE ;
1784
1784
}
1785
1785
1786
- /* Parse a ZenithFeedback message, or the ZenithFeedback part of an AppendResponse */
1786
+ /* Parse a ReplicationFeedback message, or the ReplicationFeedback part of an AppendResponse */
1787
1787
void
1788
- ParseZenithFeedbackMessage (StringInfo reply_message , ZenithFeedback * zf )
1788
+ ParseReplicationFeedbackMessage (StringInfo reply_message , ReplicationFeedback * rf )
1789
1789
{
1790
1790
uint8 nkeys ;
1791
1791
int i ;
@@ -1800,42 +1800,42 @@ ParseZenithFeedbackMessage(StringInfo reply_message, ZenithFeedback *zf)
1800
1800
if (strcmp (key , "current_timeline_size" ) == 0 )
1801
1801
{
1802
1802
pq_getmsgint (reply_message , sizeof (int32 )); // read value length
1803
- zf -> currentClusterSize = pq_getmsgint64 (reply_message );
1804
- elog (DEBUG2 , "ParseZenithFeedbackMessage : current_timeline_size %lu" ,
1805
- zf -> currentClusterSize );
1803
+ rf -> currentClusterSize = pq_getmsgint64 (reply_message );
1804
+ elog (DEBUG2 , "ParseReplicationFeedbackMessage : current_timeline_size %lu" ,
1805
+ rf -> currentClusterSize );
1806
1806
}
1807
1807
else if (strcmp (key , "ps_writelsn" ) == 0 )
1808
1808
{
1809
1809
pq_getmsgint (reply_message , sizeof (int32 )); // read value length
1810
- zf -> ps_writelsn = pq_getmsgint64 (reply_message );
1811
- elog (DEBUG2 , "ParseZenithFeedbackMessage : ps_writelsn %X/%X" ,
1812
- LSN_FORMAT_ARGS (zf -> ps_writelsn ));
1810
+ rf -> ps_writelsn = pq_getmsgint64 (reply_message );
1811
+ elog (DEBUG2 , "ParseReplicationFeedbackMessage : ps_writelsn %X/%X" ,
1812
+ LSN_FORMAT_ARGS (rf -> ps_writelsn ));
1813
1813
}
1814
1814
else if (strcmp (key , "ps_flushlsn" ) == 0 )
1815
1815
{
1816
1816
pq_getmsgint (reply_message , sizeof (int32 )); // read value length
1817
- zf -> ps_flushlsn = pq_getmsgint64 (reply_message );
1818
- elog (DEBUG2 , "ParseZenithFeedbackMessage : ps_flushlsn %X/%X" ,
1819
- LSN_FORMAT_ARGS (zf -> ps_flushlsn ));
1817
+ rf -> ps_flushlsn = pq_getmsgint64 (reply_message );
1818
+ elog (DEBUG2 , "ParseReplicationFeedbackMessage : ps_flushlsn %X/%X" ,
1819
+ LSN_FORMAT_ARGS (rf -> ps_flushlsn ));
1820
1820
}
1821
1821
else if (strcmp (key , "ps_applylsn" ) == 0 )
1822
1822
{
1823
1823
pq_getmsgint (reply_message , sizeof (int32 )); // read value length
1824
- zf -> ps_applylsn = pq_getmsgint64 (reply_message );
1825
- elog (DEBUG2 , "ParseZenithFeedbackMessage : ps_applylsn %X/%X" ,
1826
- LSN_FORMAT_ARGS (zf -> ps_applylsn ));
1824
+ rf -> ps_applylsn = pq_getmsgint64 (reply_message );
1825
+ elog (DEBUG2 , "ParseReplicationFeedbackMessage : ps_applylsn %X/%X" ,
1826
+ LSN_FORMAT_ARGS (rf -> ps_applylsn ));
1827
1827
}
1828
1828
else if (strcmp (key , "ps_replytime" ) == 0 )
1829
1829
{
1830
1830
pq_getmsgint (reply_message , sizeof (int32 )); // read value length
1831
- zf -> ps_replytime = pq_getmsgint64 (reply_message );
1831
+ rf -> ps_replytime = pq_getmsgint64 (reply_message );
1832
1832
{
1833
1833
char * replyTimeStr ;
1834
1834
1835
1835
/* Copy because timestamptz_to_str returns a static buffer */
1836
- replyTimeStr = pstrdup (timestamptz_to_str (zf -> ps_replytime ));
1837
- elog (DEBUG2 , "ParseZenithFeedbackMessage : ps_replytime %lu reply_time: %s" ,
1838
- zf -> ps_replytime , replyTimeStr );
1836
+ replyTimeStr = pstrdup (timestamptz_to_str (rf -> ps_replytime ));
1837
+ elog (DEBUG2 , "ParseReplicationFeedbackMessage : ps_replytime %lu reply_time: %s" ,
1838
+ rf -> ps_replytime , replyTimeStr );
1839
1839
1840
1840
pfree (replyTimeStr );
1841
1841
}
@@ -1844,7 +1844,7 @@ ParseZenithFeedbackMessage(StringInfo reply_message, ZenithFeedback *zf)
1844
1844
{
1845
1845
len = pq_getmsgint (reply_message , sizeof (int32 )); // read value length
1846
1846
// Skip unknown keys to support backward compatibile protocol changes
1847
- elog (LOG , "ParseZenithFeedbackMessage : unknown key: %s len %d" , key , len );
1847
+ elog (LOG , "ParseReplicationFeedbackMessage : unknown key: %s len %d" , key , len );
1848
1848
pq_getmsgbytes (reply_message , len );
1849
1849
};
1850
1850
}
@@ -1924,7 +1924,7 @@ GetAcknowledgedByQuorumWALPosition(void)
1924
1924
}
1925
1925
1926
1926
/*
1927
- * ZenithFeedbackShmemSize --- report amount of shared memory space needed
1927
+ * ReplicationFeedbackShmemSize --- report amount of shared memory space needed
1928
1928
*/
1929
1929
Size
1930
1930
WalproposerShmemSize (void )
@@ -1953,16 +1953,16 @@ WalproposerShmemInit(void)
1953
1953
}
1954
1954
1955
1955
void
1956
- zenith_feedback_set ( ZenithFeedback * zf )
1956
+ replication_feedback_set ( ReplicationFeedback * rf )
1957
1957
{
1958
1958
SpinLockAcquire (& walprop_shared -> mutex );
1959
- memcpy (& walprop_shared -> feedback , zf , sizeof (ZenithFeedback ));
1959
+ memcpy (& walprop_shared -> feedback , rf , sizeof (ReplicationFeedback ));
1960
1960
SpinLockRelease (& walprop_shared -> mutex );
1961
1961
}
1962
1962
1963
1963
1964
1964
void
1965
- zenith_feedback_get_lsns (XLogRecPtr * writeLsn , XLogRecPtr * flushLsn , XLogRecPtr * applyLsn )
1965
+ replication_feedback_get_lsns (XLogRecPtr * writeLsn , XLogRecPtr * flushLsn , XLogRecPtr * applyLsn )
1966
1966
{
1967
1967
SpinLockAcquire (& walprop_shared -> mutex );
1968
1968
* writeLsn = walprop_shared -> feedback .ps_writelsn ;
@@ -1973,37 +1973,37 @@ zenith_feedback_get_lsns(XLogRecPtr *writeLsn, XLogRecPtr *flushLsn, XLogRecPtr
1973
1973
1974
1974
1975
1975
/*
1976
- * Get ZenithFeedback fields from the most advanced safekeeper
1976
+ * Get ReplicationFeedback fields from the most advanced safekeeper
1977
1977
*/
1978
1978
static void
1979
- GetLatestZentihFeedback (ZenithFeedback * zf )
1979
+ GetLatestZentihFeedback (ReplicationFeedback * rf )
1980
1980
{
1981
1981
int latest_safekeeper = 0 ;
1982
1982
XLogRecPtr ps_writelsn = InvalidXLogRecPtr ;
1983
1983
for (int i = 0 ; i < n_safekeepers ; i ++ )
1984
1984
{
1985
- if (safekeeper [i ].appendResponse .zf .ps_writelsn > ps_writelsn )
1985
+ if (safekeeper [i ].appendResponse .rf .ps_writelsn > ps_writelsn )
1986
1986
{
1987
1987
latest_safekeeper = i ;
1988
- ps_writelsn = safekeeper [i ].appendResponse .zf .ps_writelsn ;
1988
+ ps_writelsn = safekeeper [i ].appendResponse .rf .ps_writelsn ;
1989
1989
}
1990
1990
}
1991
1991
1992
- zf -> currentClusterSize = safekeeper [latest_safekeeper ].appendResponse .zf .currentClusterSize ;
1993
- zf -> ps_writelsn = safekeeper [latest_safekeeper ].appendResponse .zf .ps_writelsn ;
1994
- zf -> ps_flushlsn = safekeeper [latest_safekeeper ].appendResponse .zf .ps_flushlsn ;
1995
- zf -> ps_applylsn = safekeeper [latest_safekeeper ].appendResponse .zf .ps_applylsn ;
1996
- zf -> ps_replytime = safekeeper [latest_safekeeper ].appendResponse .zf .ps_replytime ;
1992
+ rf -> currentClusterSize = safekeeper [latest_safekeeper ].appendResponse .rf .currentClusterSize ;
1993
+ rf -> ps_writelsn = safekeeper [latest_safekeeper ].appendResponse .rf .ps_writelsn ;
1994
+ rf -> ps_flushlsn = safekeeper [latest_safekeeper ].appendResponse .rf .ps_flushlsn ;
1995
+ rf -> ps_applylsn = safekeeper [latest_safekeeper ].appendResponse .rf .ps_applylsn ;
1996
+ rf -> ps_replytime = safekeeper [latest_safekeeper ].appendResponse .rf .ps_replytime ;
1997
1997
1998
1998
elog (DEBUG2 , "GetLatestZentihFeedback: currentClusterSize %lu,"
1999
1999
" ps_writelsn %X/%X, ps_flushlsn %X/%X, ps_applylsn %X/%X, ps_replytime %lu" ,
2000
- zf -> currentClusterSize ,
2001
- LSN_FORMAT_ARGS (zf -> ps_writelsn ),
2002
- LSN_FORMAT_ARGS (zf -> ps_flushlsn ),
2003
- LSN_FORMAT_ARGS (zf -> ps_applylsn ),
2004
- zf -> ps_replytime );
2000
+ rf -> currentClusterSize ,
2001
+ LSN_FORMAT_ARGS (rf -> ps_writelsn ),
2002
+ LSN_FORMAT_ARGS (rf -> ps_flushlsn ),
2003
+ LSN_FORMAT_ARGS (rf -> ps_applylsn ),
2004
+ rf -> ps_replytime );
2005
2005
2006
- zenith_feedback_set ( zf );
2006
+ replication_feedback_set ( rf );
2007
2007
}
2008
2008
2009
2009
static void
@@ -2016,16 +2016,16 @@ HandleSafekeeperResponse(void)
2016
2016
2017
2017
2018
2018
minQuorumLsn = GetAcknowledgedByQuorumWALPosition ();
2019
- diskConsistentLsn = quorumFeedback .zf .ps_flushlsn ;
2019
+ diskConsistentLsn = quorumFeedback .rf .ps_flushlsn ;
2020
2020
2021
2021
if (!syncSafekeepers )
2022
2022
{
2023
- // Get ZenithFeedback fields from the most advanced safekeeper
2024
- GetLatestZentihFeedback (& quorumFeedback .zf );
2025
- SetZenithCurrentClusterSize (quorumFeedback .zf .currentClusterSize );
2023
+ // Get ReplicationFeedback fields from the most advanced safekeeper
2024
+ GetLatestZentihFeedback (& quorumFeedback .rf );
2025
+ SetZenithCurrentClusterSize (quorumFeedback .rf .currentClusterSize );
2026
2026
}
2027
2027
2028
- if (minQuorumLsn > quorumFeedback .flushLsn || diskConsistentLsn != quorumFeedback .zf .ps_flushlsn )
2028
+ if (minQuorumLsn > quorumFeedback .flushLsn || diskConsistentLsn != quorumFeedback .rf .ps_flushlsn )
2029
2029
{
2030
2030
2031
2031
if (minQuorumLsn > quorumFeedback .flushLsn )
@@ -2039,7 +2039,7 @@ HandleSafekeeperResponse(void)
2039
2039
//flush_lsn - This is what durably stored in WAL service.
2040
2040
quorumFeedback .flushLsn ,
2041
2041
//apply_lsn - This is what processed and durably saved at pageserver.
2042
- quorumFeedback .zf .ps_flushlsn ,
2042
+ quorumFeedback .rf .ps_flushlsn ,
2043
2043
GetCurrentTimestamp (), false);
2044
2044
}
2045
2045
@@ -2222,7 +2222,7 @@ AsyncReadMessage(Safekeeper *sk, AcceptorProposerMessage *anymsg)
2222
2222
msg -> hs .xmin .value = pq_getmsgint64_le (& s );
2223
2223
msg -> hs .catalog_xmin .value = pq_getmsgint64_le (& s );
2224
2224
if (buf_size > APPENDRESPONSE_FIXEDPART_SIZE )
2225
- ParseZenithFeedbackMessage (& s , & msg -> zf );
2225
+ ParseReplicationFeedbackMessage (& s , & msg -> rf );
2226
2226
pq_getmsgend (& s );
2227
2227
return true;
2228
2228
}
0 commit comments