-
Notifications
You must be signed in to change notification settings - Fork 314
fix: manual compact unexpected start #1565
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
Open
ninsmiracle
wants to merge
9
commits into
apache:master
Choose a base branch
from
ninsmiracle:fix_manual_compact_unexpected_start
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e524ab6
fix_manual_compact_unexpected_start
46d8f21
Merge branch 'apache:master' into fix_manual_compact_unexpected_start
ninsmiracle 24fb407
add unit test case
75ab897
add _time_natural_increase
e607a78
add unit test
1371b6c
del useless code
48c3469
reformat code
6e1b9ac
del useless note
c4e4ff5
add some comment for new manual compact state
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,7 +91,18 @@ class pegasus_manual_compact_service : public dsn::replication::replica_base | |
|
||
// manual compact state | ||
std::atomic<bool> _disabled; | ||
// when trigger time is larger than current time,there are two situation | ||
// 1. The current day is the day when the user first sets the manual compaction trigger time, | ||
// and the user sets a time earlier than the time of this action. | ||
// 2. The current day is not the day when the user first sets the time. We should ensure that | ||
// manual compaction is executed. | ||
// The flag _time_natural_increase indicates if the current time is later than the trigger time, | ||
// causing time to progress. | ||
// The flag _manual_compact_first_day_s records the day's midnight when the user set the manual | ||
// compaction time. | ||
std::atomic<bool> _time_natural_increase; | ||
std::atomic<int> _max_concurrent_running_count; | ||
std::atomic<uint64_t> _manual_compact_first_day_s; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please add some comments for the newly added variable? The logic is too complex if adding these variables, if the current "periodic", "max_concurrent_running" features are not well implemented, I don't mind you to rewrite or even remove them. |
||
std::atomic<uint64_t> _manual_compact_enqueue_time_ms; | ||
std::atomic<uint64_t> _manual_compact_start_running_time_ms; | ||
std::atomic<uint64_t> _manual_compact_last_finish_time_ms; | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It's allowed to set multiple periodic compact tasks on a table, for example there are 2 tasks set to be executed at 02:00 and 16:00, now real world time is 15:00, will the second task (16:00 one) to be executed normally?