-
Notifications
You must be signed in to change notification settings - Fork 685
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
Cancel activedefrag in case we empty db #1411
base: unstable
Are you sure you want to change the base?
Cancel activedefrag in case we empty db #1411
Conversation
Signed-off-by: Ran Shidlansik <[email protected]>
Signed-off-by: Ran Shidlansik <[email protected]>
@JimB123 can you please take a look? |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## unstable #1411 +/- ##
============================================
+ Coverage 70.78% 70.85% +0.06%
============================================
Files 118 118
Lines 63561 63596 +35
============================================
+ Hits 44994 45059 +65
+ Misses 18567 18537 -30
|
Before doing this, I'd like to look at the defrag code to see if there's a better solution. But this is certainly an option. |
Would a better solution be to modify The only thing that needs to be check is if I'm worried about a RL case I saw once... A customer had 2 DBs, a big one and a small one. They were repeatedly flushing the small one (every few seconds). If we cancel the entire defrag operation, the bigger/stable DB might keep getting interrupted before completing defrag - and repeatedly have to start over from the beginning. |
Yes this is something we discussed and I agree is a potential issue. I think working with indexes should always be preferred.
I do not think there is any issue with that the cursor is blind to memory location AFAIK. |
Not exactly, I think that reduces the flexibility of the kvstore helper - which is used for other kvstores (like pubsub). What I'm thinking is to:
|
In case we empty database (eg user triggers flushdb command) the activedefrag might be in the process of scanning over the db kvstore.
Example:
In order to avoid such issues we will reset activedefrag to start all over again.