Skip to content
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

Merged
merged 4 commits into from
Aug 22, 2023

Conversation

koivunej
Copy link
Member

@koivunej koivunej commented Aug 22, 2023

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.

@koivunej koivunej requested review from a team as code owners August 22, 2023 07:44
@koivunej koivunej requested review from conradludgate and skyzh and removed request for a team August 22, 2023 07:44
@koivunej
Copy link
Member Author

This has a boring clippy, I will fix it after remove_remote_layer_6 has been merged.

@github-actions
Copy link

github-actions bot commented Aug 22, 2023

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:

@koivunej koivunej removed the request for review from skyzh August 22, 2023 08:24
@@ -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
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair

Copy link
Member Author

@koivunej koivunej Aug 24, 2023

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.

@koivunej koivunej force-pushed the remove_remote_layer_7 branch 3 times, most recently from 97d1443 to 258c265 Compare August 22, 2023 14:32
Copy link
Contributor

@problame problame left a 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.

@koivunej
Copy link
Member Author

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.

Base automatically changed from remove_remote_layer_6 to main August 22, 2023 18:14
@koivunej koivunej merged commit ad8d777 into main Aug 22, 2023
29 checks passed
@koivunej koivunej deleted the remove_remote_layer_7 branch August 22, 2023 19:12
koivunej added a commit that referenced this pull request Oct 26, 2023
…#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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants