-
Notifications
You must be signed in to change notification settings - Fork 14
XLog a key rotation event rather than the result #225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAttention: Patch coverage is
❌ Your project status has failed because the head coverage (75.45%) is below the target coverage (90.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## TDE_REL_17_STABLE #225 +/- ##
=====================================================
- Coverage 76.29% 75.45% -0.85%
=====================================================
Files 23 22 -1
Lines 2523 2465 -58
Branches 395 388 -7
=====================================================
- Hits 1925 1860 -65
- Misses 521 532 +11
+ Partials 77 73 -4
🚀 New features to boost your workflow:
|
b50f546 to
8326d94
Compare
jeltz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the general approach but I have some feedback on the code.
8326d94 to
e534a67
Compare
jeltz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found two small things.
e534a67 to
a34f85f
Compare
Before this commit, we Xlogged the binary result of the _map file content during key rotation. This led to issues: 1. Replicas would rewrite their own WAL keys with the primary's ones. And WAL keys are different on replicas. The same would have happened with SMGR keys since we're also planning to have them different across replicas. 2. The crash recovery would rewrite the latest WAL key as it's being created before redo. This commit switches to rather Xlogging the event of rotation (to which key should rotate) and lets redo/replicas perform the actual rotation. Fixes PG-1468, PG-1541
a34f85f to
b1da29f
Compare
jeltz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good but it would be nice if we could also start writing TAP tests for things like this. I started with a very simple TAP test for replication.
Before this commit, we Xlogged the binary result of the _map file content during key rotation. This led to issues:
This commit switches to rather Xlogging the event of rotation (to which key should rotate) and lets redo/replicas perform the actual rotation.
Fixes PG-1468, PG-1541