Fit for exterm RTO and parallel redo for replicaiton origin.

This commit is contained in:
TotaJ
2021-12-20 15:43:19 +08:00
parent 27bdb0d62b
commit e40b7dc8cd
3 changed files with 19 additions and 0 deletions

View File

@ -1743,6 +1743,7 @@ static const XLogParseBlock g_xlogParseBlockTable[RM_MAX_ID + 1] = {
{ UBTreeRedoParseToBlock, RM_UBTREE_ID },
{ UBTree2RedoParseToBlock, RM_UBTREE2_ID },
{ segpage_redo_parse_to_block, RM_SEGPAGE_ID },
{ NULL, RM_REPLORIGIN_ID },
};
inline XLogRecParseState *XLogParseToBlockCommonFunc(XLogReaderState *record, uint32 *blocknum)
{

View File

@ -142,6 +142,7 @@ static bool DispatchMotRecord(XLogReaderState* record, List* expectedTLIs, Times
#endif
static bool DispatchBtreeRecord(XLogReaderState *record, List *expectedTLIs, TimestampTz recordXTime);
static bool DispatchSegpageSmgrRecord(XLogReaderState *record, List *expectedTLIs, TimestampTz recordXTime);
static bool DispatchRepOriginRecord(XLogReaderState *record, List *expectedTLIs, TimestampTz recordXTime);
static bool DispatchUBTreeRecord(XLogReaderState *record, List *expectedTLIs, TimestampTz recordXTime);
static bool DispatchUBTree2Record(XLogReaderState* record, List* expectedTLIs, TimestampTz recordXTime);
@ -209,6 +210,7 @@ static const RmgrDispatchData g_dispatchTable[RM_MAX_ID + 1] = {
XLOG_UBTREE2_FREEZE },
{ DispatchSegpageSmgrRecord, RmgrRecordInfoValid, RM_SEGPAGE_ID, XLOG_SEG_ATOMIC_OPERATION,
XLOG_SEG_NEW_PAGE},
{ DispatchRepOriginRecord, RmgrRecordInfoValid, RM_REPLORIGIN_ID, XLOG_REPLORIGIN_SET, XLOG_REPLORIGIN_DROP },
};
void UpdateDispatcherStandbyState(HotStandbyState *state)
@ -1146,6 +1148,13 @@ static bool DispatchSegpageSmgrRecord(XLogReaderState *record, List *expectedTLI
return isNeedFullSync;
}
/* Run from the dispatcher thread. */
static bool DispatchRepOriginRecord(XLogReaderState *record, List *expectedTLIs, TimestampTz recordXTime)
{
DispatchTxnRecord(record, expectedTLIs, recordXTime, false);
return false;
}
/* Run from the dispatcher thread. */
static bool DispatchCLogRecord(XLogReaderState *record, List *expectedTLIs, TimestampTz recordXTime)
{

View File

@ -151,6 +151,7 @@ static bool DispatchUBTree2Record(XLogReaderState *record, List *expectedTLIs, T
static bool DispatchMotRecord(XLogReaderState *record, List *expectedTLIs, TimestampTz recordXTime);
#endif
static bool DispatchSegpageSmgrRecord(XLogReaderState *record, List *expectedTLIs, TimestampTz recordXTime);
static bool DispatchRepOriginRecord(XLogReaderState *record, List *expectedTLIs, TimestampTz recordXTime);
static bool RmgrRecordInfoValid(XLogReaderState *record, uint8 minInfo, uint8 maxInfo);
static bool RmgrGistRecordInfoValid(XLogReaderState *record, uint8 minInfo, uint8 maxInfo);
@ -207,6 +208,7 @@ static const RmgrDispatchData g_dispatchTable[RM_MAX_ID + 1] = {
XLOG_UBTREE2_FREEZE },
{ DispatchSegpageSmgrRecord, RmgrRecordInfoValid, RM_SEGPAGE_ID, XLOG_SEG_ATOMIC_OPERATION,
XLOG_SEG_NEW_PAGE },
{ DispatchRepOriginRecord, RmgrRecordInfoValid, RM_REPLORIGIN_ID, XLOG_REPLORIGIN_SET, XLOG_REPLORIGIN_DROP },
};
/* Run from the dispatcher and txn worker thread. */
@ -1055,6 +1057,13 @@ static bool DispatchSegpageSmgrRecord(XLogReaderState* record, List* expectedTLI
return isNeedFullSync;
}
/* Run from the dispatcher thread. */
static bool DispatchRepOriginRecord(XLogReaderState *record, List *expectedTLIs, TimestampTz recordXTime)
{
DispatchTxnRecord(record, expectedTLIs, recordXTime, false);
return false;
}
/* Run from the dispatcher thread. */
static bool DispatchCLogRecord(XLogReaderState *record, List *expectedTLIs, TimestampTz recordXTime)
{