-
Notifications
You must be signed in to change notification settings - Fork 440
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
refactor: remove is_incremental=true for ImageLayers footgun #5061
Conversation
This has a boring clippy, I will fix it after remove_remote_layer_6 has been merged. |
1624 tests run: 1550 passed, 0 failed, 74 skipped (full report)The comment gets automatically updated with the latest test results
536c051 at 2023-08-22T18:45:15.048Z :recycle: |
@@ -623,7 +618,6 @@ impl ImageLayerWriterInner { | |||
self.timeline_id, | |||
self.key_range.clone(), | |||
self.lsn, | |||
self.is_incremental, // for now, image layer ALWAYS covers the full range |
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.
Maybe there should be an assert/warning/bail here to ensure that self.is_incremental
is false?
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 was thinking of adding one to load_layer_map, but here it cannot be true, because there's no such bool.
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.
Fair
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.
Did you mean here that I forgot to remove the is_incremental from ImageLayerWriter
?
EDIT: It does not seem so. Okay, must've just botched the rebase.
97d1443
to
258c265
Compare
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.
There are still more references to "incremental" throughout the gc & layer map code that might better be using is_delta
. But, let's keep this PR as it is, it's already an improvement.
Yeah I don't feel like I have much insight into removing more, except for this infuriating api removed here. |
118aa38
to
e3cf790
Compare
258c265
to
0f117eb
Compare
0f117eb
to
536c051
Compare
…#4938) Implement a new `struct Layer` abstraction which manages downloadness internally, requiring no LayerMap locking or rewriting to download or evict providing a property "you have a layer, you can read it". The new `struct Layer` provides ability to keep the file resident via a RAII structure for new layers which still need to be uploaded. Previous solution solved this `RemoteTimelineClient::wait_completion` which lead to bugs like #5639. Evicting or the final local deletion after garbage collection is done using Arc'd value `Drop`. With a single `struct Layer` the closed open ended `trait Layer`, `trait PersistentLayer` and `struct RemoteLayer` are removed following noting that compaction could be simplified by simply not using any of the traits in between: #4839. The new `struct Layer` is a preliminary to remove `Timeline::layer_removal_cs` documented in #4745. Preliminaries: #4936, #4937, #5013, #5014, #5022, #5033, #5044, #5058, #5059, #5061, #5074, #5103, epic #5172, #5645, #5649. Related split off: #5057, #5134.
Accidentially giving is_incremental=true for ImageLayers costs a lot of debugging time. Removes all API which would allow to do that. They can easily be restored later when needed.
Split off from #4938, builds upon #5059 for no obvious reason, could be separated.