-
Notifications
You must be signed in to change notification settings - Fork 453
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
Implement commitlog rotation as well as writing out, cleaning up, and bootstrapping using snapshot metadata files #1384
Conversation
// change the commitlog filename structure (because we don't rely on the name | ||
// for any information, we just list all the files in a directory and then | ||
// read their encoded heads to obtain information about them), so in the future | ||
// we can just get rid of this. |
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.
Can you add a TODO(v1): remove this when ok to be backwards incompatible
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 think this is just a regular TODO because it is backwards compatible (existing code doesn't rely on filename). I just didn't want to make the change in this P.R
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.
Sure thing.
enc.encodeVarintFn(info.Start) | ||
enc.encodeVarintFn(info.Duration) | ||
|
||
// Deprecated, have to encode anyways for backwards compatibility, but we ignore the values. |
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.
Can you add a TODO(v1): remove when we can make backwards incompatible changes with an upgrade to v1
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.
LGTM
abd8d2c
to
d076698
Compare
Codecov Report
@@ Coverage Diff @@
## master #1384 +/- ##
========================================
- Coverage 70.8% 70.7% -0.2%
========================================
Files 834 827 -7
Lines 71509 71194 -315
========================================
- Hits 50684 50365 -319
- Misses 17516 17525 +9
+ Partials 3309 3304 -5
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #1384 +/- ##
========================================
- Coverage 70.8% 70.8% -0.1%
========================================
Files 834 834
Lines 71509 71482 -27
========================================
- Hits 50684 50649 -35
- Misses 17516 17526 +10
+ Partials 3309 3307 -2
Continue to review full report at Codecov.
|
Summary
This P.R implements the following functionality:
Review guide
Unfortunately its very difficult to make this P.R any smaller because as soon as writing out the snapshot metadata files is implemented, the cleanup logic needs to be implemented, and if the cleanup logic is implemented then the bootstrapping logic needs to be implemented as well.
Luckily, while this is a large P.R, there are much more deletions than additions, and the vast majority of the new code is a simplification of previously much more complicated code. I,E a lot of the code that was rewritten went from very complicated logic to very simple logic.
Places to pay particular attention to in the review:
cleanup.go
commitlog.go
(removed the concept of rotating files by time entirely, and commitlog files will only be rotated when an explicit call toRotateLogs()
is made.persist_manager.go
flush.go