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

Fix wrong assert delta < 0 for cocurrent compaction while flush #172

Merged
merged 6 commits into from
Jun 4, 2020

Conversation

Connor1996
Copy link
Member

@Connor1996 Connor1996 commented Jun 2, 2020

Because the flushed SST is added to superversion before OnFlushCompleted() is called, so if there is a concurrent compaction, OnCompactionCompleted() maybe called before OnFlushCompleted() is called.
In this case, the state of the blob file generated by the flush is still kPendingLSM, while the blob file size delta is for the compaction event. So it is possible that delta is negative.

Fix #171

Signed-off-by: Connor1996 <zbk602423539@gmail.com>
Signed-off-by: Connor1996 <zbk602423539@gmail.com>
Signed-off-by: Connor1996 <zbk602423539@gmail.com>
Signed-off-by: Connor1996 <zbk602423539@gmail.com>
@Connor1996 Connor1996 added the needs-cherry-pick-4.x Type: Need cherry pick to tikv-4.x label Jun 2, 2020
src/db_impl.cc Outdated Show resolved Hide resolved
src/db_impl.cc Outdated Show resolved Hide resolved
src/db_impl.cc Outdated Show resolved Hide resolved
Signed-off-by: Connor1996 <zbk602423539@gmail.com>
@codecov
Copy link

codecov bot commented Jun 3, 2020

Codecov Report

Merging #172 into master will decrease coverage by 0.02%.
The diff coverage is 78.57%.

@@            Coverage Diff             @@
##           master     #172      +/-   ##
==========================================
- Coverage   85.90%   85.87%   -0.03%     
==========================================
  Files          47       47              
  Lines        3548     3555       +7     
==========================================
+ Hits         3048     3053       +5     
- Misses        500      502       +2     

Copy link
Collaborator

@yiwu-arbug yiwu-arbug left a comment

Choose a reason for hiding this comment

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

LGTM

@Connor1996 Connor1996 added the status/can-merge Status: Can merge to base branch label Jun 4, 2020
@sre-bot
Copy link

sre-bot commented Jun 4, 2020

/run-all-tests

@sre-bot
Copy link

sre-bot commented Jun 4, 2020

@Connor1996 merge failed.

@Connor1996 Connor1996 merged commit 167e65b into tikv:master Jun 4, 2020
@sre-bot
Copy link

sre-bot commented Jun 4, 2020

cherry pick to tikv-4.x failed

Connor1996 added a commit to Connor1996/titan that referenced this pull request Jun 4, 2020
…#172)

* fix cocurrent compaction while flush

Signed-off-by: Connor1996 <zbk602423539@gmail.com>
Connor1996 added a commit that referenced this pull request Jun 4, 2020
#176)

* fix cocurrent compaction while flush

Signed-off-by: Connor1996 <zbk602423539@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-4.x Type: Need cherry pick to tikv-4.x status/can-merge Status: Can merge to base branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

titan_thread_safety_test failed
3 participants