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

Don't return error on missing writable bucket during cold flush #2188

Merged
merged 4 commits into from
Mar 3, 2020

Conversation

justinjc
Copy link
Collaborator

@justinjc justinjc commented Mar 2, 2020

What this PR does / why we need it:

During a cold flush, we first collect all the block starts that require cold flushing. This includes two cases:

  1. Any block that has a cold bucket with new un-flushed writes (a "writable bucket")
  2. Any block that has a cold bucket with writes that have failed to flush completely

After getting all these blocks, we go through each one to fetch data and compact.

Therefore when fetching data for a ColdFlush, encountering a block that has no writable bucket is not an error, since that means we're hitting case (2).

Please see the section explaining bucket versions here for more context if needed.

Special notes for your reviewer: N/A

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 Mar 2, 2020

Codecov Report

Merging #2188 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #2188   +/-   ##
======================================
  Coverage    66.8%   66.8%           
======================================
  Files        1016    1016           
  Lines       88298   88298           
======================================
  Hits        59026   59026           
  Misses      25070   25070           
  Partials     4202    4202
Flag Coverage Δ
#aggregator 78.7% <0%> (ø) ⬆️
#cluster 85.2% <0%> (ø) ⬆️
#collector 82.8% <0%> (ø) ⬆️
#dbnode 75.7% <0%> (ø) ⬆️
#m3em 58.1% <0%> (ø) ⬆️
#m3ninx 74.2% <0%> (ø) ⬆️
#m3nsch 51.1% <0%> (ø) ⬆️
#metrics 17.6% <0%> (ø) ⬆️
#msg 74.8% <0%> (ø) ⬆️
#query 54.9% <0%> (ø) ⬆️
#x 71.7% <0%> (ø) ⬆️

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 b2f9f4c...eb6329e. Read the comment docs.

// No-op if the writable bucket doesn't exist.
// This function should only get called for blocks that we know need to be
// cold flushed. However, buckets that get attempted to be cold flushed and
// fail need to get cold flushed as well. These kinds of buckets will have
Copy link
Contributor

Choose a reason for hiding this comment

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

Dumb clarification question--why is the version non writeable on the retry?

Copy link
Collaborator Author

@justinjc justinjc Mar 3, 2020

Choose a reason for hiding this comment

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

Nah not dumb. The "writeable" bucket version is always zero. When we cold flush, we mark the writeable bucket a different version so that we know which buckets have flushed - this version stamp is done in the if block above.

However, when we change the version above, we're not actually flushed because we don't write to disk until every series in this shard is complete flushing. Therefore, if we for some reason fail to flush for some other series, this bucket that we just marked as a different version needs to be flushed again the next time we try to flush.

After a successful flush, these non-writeable buckets will get evicted from memory.

@justinjc justinjc force-pushed the juchan/cold-flush-bad-err branch from c45e071 to b2f9f4c Compare March 3, 2020 19:50
@justinjc justinjc merged commit dd53ddb into master Mar 3, 2020
@robskillington robskillington deleted the juchan/cold-flush-bad-err branch March 7, 2020 03:00
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