Add hook functions for xlog, allow custom Table-AM to implement custom wal. #848
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add two hook functions for extension, make custom Table-Am can hook in xlog redo
In cloudberrydb, when mirror instance redo xlog,
StartupXLog
will start replaying from thelatest checkpoint's REDO location in pg_control. When processing the xlog of data writing,
we need to write the data in xlog into the data file, but the entire db directory may be deleted
due to the drop database xlog that has been replayed last time.
XLogDropDatabase
andXLogCheckInvalidPages
limits the table to be organized in page mode.For custom Table-Am, their data organization is not necessarily in page mode.
We need to provide a hook for the implementation of custom wal log to handle this situation.
master:
\c testdb
t1: create table t1(a int);
t2: select pg_sleep(checkpoint_timeout); --wait checkpoint_timeout, do checkpoint on mirror;
t3: insert into t1 select generate_series(1,10);
t4: dropdb testdb
t5: pkill postgres -- mirror should redo dropdb and not do next checkpoint on mirror
then we restart the cluster, mirror will recovery restart at the xlog of insert sql, but the data path of testdb has been deleted
Fixes #ISSUE_Number
What does this PR do?
Type of Change
Breaking Changes
Test Plan
make installcheck
make -C src/test installcheck-cbdb-parallel
Impact
Performance:
User-facing changes:
Dependencies:
Checklist
Additional Context
CI Skip Instructions