mirror of
https://gitee.com/he3db/he3pg.git
synced 2024-11-29 18:58:35 +08:00
fix: recovery when cross timeline and has shutdown wal
This commit is contained in:
commit
5021eb0509
@ -18,7 +18,7 @@ static void getWalFunc(gpointer data, gpointer user_data) {
|
||||
//elem->status = STARTSTATUS;
|
||||
int r;
|
||||
//clock_t start = clock();
|
||||
r = batchRead((uint8_t *) elem->data, ThisTimeLineID, elem->startLsn, elem->endLsn, walStoreToLocal);
|
||||
r = batchRead((uint8_t *) elem->data, ThisTimeLineID2>ThisTimeLineID?ThisTimeLineID2:ThisTimeLineID, elem->startLsn, elem->endLsn, walStoreToLocal);
|
||||
//clock_t end = clock();
|
||||
//printf("====LSN %X/%X==pid %d==len %d===time %u\n",LSN_FORMAT_ARGS(elem->startLsn),pthread_self(),r,end-start);
|
||||
elem->dataLen = r;
|
||||
|
@ -224,6 +224,7 @@ CheckpointStatsData CheckpointStats;
|
||||
* WAL timeline for the database system.
|
||||
*/
|
||||
TimeLineID ThisTimeLineID = 0;
|
||||
TimeLineID ThisTimeLineID2 = 0;
|
||||
|
||||
/*
|
||||
* Are we doing recovery from XLOG?
|
||||
@ -15072,7 +15073,7 @@ WaitForWALToBecomeAvailable(XLogRecPtr RecPtr, bool randAccess,
|
||||
tli, curFileTLI);
|
||||
}
|
||||
curFileTLI = tli;
|
||||
ThisTimeLineID = tli;
|
||||
ThisTimeLineID2 = tli;
|
||||
RequestXLogStreaming(tli, ptr, PrimaryConnInfo,
|
||||
PrimarySlotName,
|
||||
wal_receiver_create_temp_slot);
|
||||
|
@ -31,6 +31,7 @@
|
||||
extern int sync_method;
|
||||
|
||||
extern PGDLLIMPORT TimeLineID ThisTimeLineID; /* current TLI */
|
||||
extern PGDLLIMPORT TimeLineID ThisTimeLineID2;
|
||||
extern bool startup_shutdown_requested;
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user