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

compaction_manager: run_offstrategy_compaction: retrieve owned_ranges from compaction_state #15043

Conversation

bhalevy
Copy link
Member

@bhalevy bhalevy commented Aug 14, 2023

perform_offstrategy is called from try_perform_cleanup
when there are sstables in the maintenance set that require
cleanup.

The input sstables are inserted into the compaction_state
sstables_requiring_cleanup and try_perform_cleanup
expects offstrategy compaction to clean them up along
with reshape compaction.

Otherwise, the maintenance sstables that require cleanup
are not cleaned up by cleanup compaction, since
the reshape output sstable(s) are not analyzed again
after reshape compaction, where that would insert
the output sstable(s) into sstables_requiring_cleanup
and trigger their cleanup in the subsequent cleanup compaction.

The latter method is viable too, but it is less effficient
since we can do reshape+cleanup in one pass, vs.
reshape first and cleanup later.

Fixes #15041

@bhalevy bhalevy requested a review from nyh as a code owner August 14, 2023 10:06
@bhalevy bhalevy requested a review from raphaelsc August 14, 2023 10:07
@avikivity
Copy link
Member

Please elaborate, why must it piggyback cleanup on reshape?

… from compaction_state

perform_offstrategy is called from try_perform_cleanup
when there are sstables in the maintenance set that require
cleanup.

The input sstables are inserted into the compaction_state
`sstables_requiring_cleanup` and `try_perform_cleanup`
expects offstrategy compaction to clean them up along
with reshape compaction.

Otherwise, the maintenance sstables that require cleanup
are not cleaned up by cleanup compaction, since
the reshape output sstable(s) are not analyzed again
after reshape compaction, where that would insert
the output sstable(s) into `sstables_requiring_cleanup`
and trigger their cleanup in the subsequent cleanup compaction.

The latter method is viable too, but it is less effficient
since we can do reshape+cleanup in one pass, vs.
reshape first and cleanup later.

Fixes scylladb#15041

Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
@github-actions github-actions bot deleted a comment from aws-amplify-us-east-2 bot Aug 14, 2023
@bhalevy bhalevy force-pushed the compaction-offstrategy-piggyback-cleanup branch from 81dd87b to f9935e7 Compare August 14, 2023 10:13
@bhalevy
Copy link
Member Author

bhalevy commented Aug 14, 2023

Please elaborate, why must it piggyback cleanup on reshape?

Elaborated patch change log, and respective PR description.

@github-actions github-actions bot deleted a comment from aws-amplify-us-east-2 bot Aug 14, 2023
@avikivity
Copy link
Member

Please update the issue too. An issue must describe something that is wrong to deserve being fixed. "Should" just moves the responsibility to figuring out what's wrong to the reader.

@bhalevy
Copy link
Member Author

bhalevy commented Aug 14, 2023

Please update the issue too. An issue must describe something that is wrong to deserve being fixed. "Should" just moves the responsibility to figuring out what's wrong to the reader.

Done

@scylladb-promoter
Copy link
Contributor

@avikivity
Copy link
Member

How did you get CI to succeed?

@bhalevy
Copy link
Member Author

bhalevy commented Aug 14, 2023

How did you get CI to succeed?

Spells and sorcery

@avikivity
Copy link
Member

How did you get CI to succeed?

Spells and sorcery

A witch!

bhalevy added a commit to bhalevy/scylla that referenced this pull request Aug 15, 2023
… from compaction_state

perform_offstrategy is called from try_perform_cleanup
when there are sstables in the maintenance set that require
cleanup.

The input sstables are inserted into the compaction_state
`sstables_requiring_cleanup` and `try_perform_cleanup`
expects offstrategy compaction to clean them up along
with reshape compaction.

Otherwise, the maintenance sstables that require cleanup
are not cleaned up by cleanup compaction, since
the reshape output sstable(s) are not analyzed again
after reshape compaction, where that would insert
the output sstable(s) into `sstables_requiring_cleanup`
and trigger their cleanup in the subsequent cleanup compaction.

The latter method is viable too, but it is less effficient
since we can do reshape+cleanup in one pass, vs.
reshape first and cleanup later.

Fixes scylladb#15041

Signed-off-by: Benny Halevy <bhalevy@scylladb.com>

Closes scylladb#15043
bhalevy added a commit to bhalevy/scylla that referenced this pull request Aug 31, 2023
… from compaction_state

perform_offstrategy is called from try_perform_cleanup
when there are sstables in the maintenance set that require
cleanup.

The input sstables are inserted into the compaction_state
`sstables_requiring_cleanup` and `try_perform_cleanup`
expects offstrategy compaction to clean them up along
with reshape compaction.

Otherwise, the maintenance sstables that require cleanup
are not cleaned up by cleanup compaction, since
the reshape output sstable(s) are not analyzed again
after reshape compaction, where that would insert
the output sstable(s) into `sstables_requiring_cleanup`
and trigger their cleanup in the subsequent cleanup compaction.

The latter method is viable too, but it is less effficient
since we can do reshape+cleanup in one pass, vs.
reshape first and cleanup later.

\Fixes scylladb#15041

Signed-off-by: Benny Halevy <bhalevy@scylladb.com>

\Closes scylladb#15043

(cherry picked from commit 9f77a32)
bhalevy added a commit to bhalevy/scylla that referenced this pull request Sep 19, 2023
… from compaction_state

perform_offstrategy is called from try_perform_cleanup
when there are sstables in the maintenance set that require
cleanup.

The input sstables are inserted into the compaction_state
`sstables_requiring_cleanup` and `try_perform_cleanup`
expects offstrategy compaction to clean them up along
with reshape compaction.

Otherwise, the maintenance sstables that require cleanup
are not cleaned up by cleanup compaction, since
the reshape output sstable(s) are not analyzed again
after reshape compaction, where that would insert
the output sstable(s) into `sstables_requiring_cleanup`
and trigger their cleanup in the subsequent cleanup compaction.

The latter method is viable too, but it is less effficient
since we can do reshape+cleanup in one pass, vs.
reshape first and cleanup later.

\Fixes scylladb#15041

Signed-off-by: Benny Halevy <bhalevy@scylladb.com>

\Closes scylladb#15043

(cherry picked from commit 9f77a32)
bhalevy added a commit to bhalevy/scylla that referenced this pull request Nov 13, 2023
… from compaction_state

perform_offstrategy is called from try_perform_cleanup
when there are sstables in the maintenance set that require
cleanup.

The input sstables are inserted into the compaction_state
`sstables_requiring_cleanup` and `try_perform_cleanup`
expects offstrategy compaction to clean them up along
with reshape compaction.

Otherwise, the maintenance sstables that require cleanup
are not cleaned up by cleanup compaction, since
the reshape output sstable(s) are not analyzed again
after reshape compaction, where that would insert
the output sstable(s) into `sstables_requiring_cleanup`
and trigger their cleanup in the subsequent cleanup compaction.

The latter method is viable too, but it is less effficient
since we can do reshape+cleanup in one pass, vs.
reshape first and cleanup later.

\Fixes scylladb#15041

Signed-off-by: Benny Halevy <bhalevy@scylladb.com>

\Closes scylladb#15043

(cherry picked from commit 9f77a32)
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.

Offstrategy compaction must piggyback cleanup on reshape when invoked from the cleanup path
3 participants