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 for index block appearing as a flushed index block, now explicit check has on disk segment #3622

Merged

Conversation

robskillington
Copy link
Collaborator

What this PR does / why we need it:

This changes the logic to detect whether a block is flushed or not (and consequently can GC in-memory series from index). Previously was checking that the block had been sealed (had at least started transition to on disk segment) and that no in-memory series were held by block any longer. This is a poor check since in-memory series are held by the active block not the block for that block start, so would return true even though the block had not been flushed.

Now the check is much more robust since it checks the result of the call to block.Tick(...) which explicitly returns whether it has a bootstrapped segment (i.e. a segment which is an on disk segment) held as a reference or not, which is the root for the source of truth on whether the in-memory series for that block start can be GC'd or not.

Special notes for your reviewer:

Does this PR introduce a user-facing and/or backwards incompatible change?:

NONE

Does this PR require updating code package or user-facing documentation?:

NONE

@codecov
Copy link

codecov bot commented Jul 26, 2021

Codecov Report

Merging #3622 (861d4b0) into r/index-active-block (ed89e86) will decrease coverage by 0.0%.
The diff coverage is 90.0%.

Impacted file tree graph

@@                  Coverage Diff                   @@
##           r/index-active-block   #3622     +/-   ##
======================================================
- Coverage                  56.2%   56.1%   -0.1%     
======================================================
  Files                       551     551             
  Lines                     62170   62178      +8     
======================================================
- Hits                      34974   34921     -53     
- Misses                    24055   24128     +73     
+ Partials                   3141    3129     -12     
Flag Coverage Δ
aggregator 57.1% <ø> (ø)
cluster ∅ <ø> (∅)
collector 58.4% <ø> (ø)
dbnode 60.6% <90.0%> (-0.2%) ⬇️
m3em 46.4% <ø> (ø)
metrics 19.8% <ø> (ø)
msg 74.4% <ø> (+0.1%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ed89e86...861d4b0. Read the comment docs.

@rallen090 rallen090 merged commit 2df8748 into r/index-active-block Jul 26, 2021
@rallen090 rallen090 deleted the r/index-active-block-fix-flushable-blocks branch July 26, 2021 15:21
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.

2 participants