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

Persist block at retention edge when building index after peer streaming #1531

Merged
merged 4 commits into from
Apr 9, 2019

Conversation

robskillington
Copy link
Collaborator

No description provided.

@codecov
Copy link

codecov bot commented Apr 4, 2019

Codecov Report

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

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #1531   +/-   ##
======================================
  Coverage    71.6%   71.6%           
======================================
  Files         948     948           
  Lines       77834   77834           
======================================
  Hits        55789   55789           
  Misses      18400   18400           
  Partials     3645    3645
Flag Coverage Δ
#aggregator 82.3% <0%> (ø) ⬆️
#cluster 85.7% <0%> (ø) ⬆️
#collector 63.7% <0%> (ø) ⬆️
#dbnode 79.9% <0%> (ø) ⬆️
#m3em 73.2% <0%> (ø) ⬆️
#m3ninx 73.8% <0%> (ø) ⬆️
#m3nsch 51.1% <0%> (ø) ⬆️
#metrics 17.5% <0%> (ø) ⬆️
#msg 75% <0%> (ø) ⬆️
#query 66.5% <0%> (ø) ⬆️
#x 85.3% <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 2ae8fdf...f58484f. Read the comment docs.

@@ -818,10 +832,12 @@ func (s *fileSystemSource) persistBootstrapIndexSegment(
// and we didn't bootstrap any more/less
requireFulfilled := expectedRanges.Copy()
requireFulfilled.Subtract(fulfilled)
exactStartEnd := min.Equal(blockStart) && max.Equal(blockStart.Add(blockSize))
exactStartEnd := max.Equal(blockStart.Add(blockSize))
Copy link
Contributor

Choose a reason for hiding this comment

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

not part of your change but the comment above is missing a "we" -> "Check that we completely..."

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done, TY.

blockEnd := blockStart.Add(blockSize)
expectedRangeStart, expectedRangeEnd := blockStart, blockEnd

// If basically the index block covers multiple data blocks
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you make this more concrete and a little easier to understand:

Index blocks can be arbitrarily larger than data blocks, but the retention of the namespace is based on the size of the data blocks, not the index blocks. As a result, it's possible that the block start for the earliest index block is before the earliest possible retention time. If that is the case, then we snap the expected range start to the earliest retention block start because that is the point in time for which we'll actually have data available to construct indices from


Example Diagram:

Index block size: 4 hours
Data block size: 2 hours
Retention: 6 hours

[10AM            ->           2PM][2PM            ->           6PM] (Index Blocks)
                       [12PM->2PM][2PM->4PM][4PM->6PM] (Data Blocks)

I dont know if what I wrote is 100% accurate but you get the idea

Copy link
Contributor

Choose a reason for hiding this comment

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

Also I understand how this resolves the validation check below where we make sure we've fulfilled the correct range, but how does it prevent the memory segment from being created? Also, the index block that starts before the retention begins is supposed to contain some data from the data block that it does overlap that IS within the retention, is that data correctly included in the index?

In the example above, the 10AM-2PM index block should contain the series that were in the 12PM-2PM data block, are we handling that correctly?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It doesn't stop the memory segment being created, it just makes sure that it turns it into an FST segment instead (and hence it becomes a not-mutable segment).

Before it was failing validation and would just return it as the mem segment that was built.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes we handle that case correctly.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

TY I used your diagram, appreciated!

@m3db m3db deleted a comment from codecov bot Apr 4, 2019
Copy link
Contributor

@richardartoul richardartoul left a comment

Choose a reason for hiding this comment

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

LGTM

@robskillington robskillington merged commit ed1cf5e into master Apr 9, 2019
@robskillington robskillington deleted the r/persist-index-block-at-retention-edge branch April 9, 2019 11:11
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