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

Make snapshot process snapshot all unflushed blocks #1017

Merged
merged 26 commits into from
Nov 16, 2018

Conversation

richardartoul
Copy link
Contributor

@richardartoul richardartoul commented Oct 4, 2018

  • - Modify snapshot behavior to snapshot all unflushed blocks within the retention period
  • - Update integration tests to capture new behavior

@richardartoul richardartoul changed the title [WIP] - Make snapshot process snapshot all unflushed blocks [WIP - Dont Review] - Make snapshot process snapshot all unflushed blocks Oct 4, 2018
@codecov
Copy link

codecov bot commented Oct 5, 2018

Codecov Report

Merging #1017 into master will decrease coverage by <.1%.
The diff coverage is 97.9%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #1017     +/-   ##
========================================
- Coverage    71.1%   71.1%   -0.1%     
========================================
  Files         732     732             
  Lines       61493   61520     +27     
========================================
+ Hits        43749   43763     +14     
- Misses      14922   14937     +15     
+ Partials     2822    2820      -2
Flag Coverage Δ
#aggregator 81.6% <ø> (ø) ⬆️
#cluster 85.8% <ø> (ø) ⬆️
#collector 78.1% <ø> (ø) ⬆️
#dbnode 80.9% <97.9%> (-0.1%) ⬇️
#m3em 73.2% <ø> (ø) ⬆️
#m3ninx 75.2% <ø> (ø) ⬆️
#m3nsch 51.1% <ø> (ø) ⬆️
#metrics 18.3% <ø> (ø) ⬆️
#msg 75.1% <ø> (+0.1%) ⬆️
#query 61.7% <ø> (ø) ⬆️
#x 75.2% <ø> (ø) ⬆️

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 903ee59...aa34af7. Read the comment docs.

@richardartoul richardartoul changed the title [WIP - Dont Review] - Make snapshot process snapshot all unflushed blocks Make snapshot process snapshot all unflushed blocks Oct 5, 2018
Copy link
Collaborator

@justinjc justinjc left a comment

Choose a reason for hiding this comment

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

LGTM with a comment, but might want to get Prateek/Rob to look over this too.

@@ -49,7 +49,7 @@ func timesInRange(startInclusive, endInclusive time.Time, windowSize time.Durati
return nil
}
times := make([]time.Time, 0, ni)
for t := endInclusive; !t.Before(startInclusive); t = t.Add(-windowSize) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Were there assumptions elsewhere in the code that relies on the time ranges always including the end time? Also fix the comment for this function.

@prateek
Copy link
Collaborator

prateek commented Oct 29, 2018

@richardartoul talked offline: maybe add a stat for the number of blocks being snapshot

snapshotFiles, err := fs.SnapshotFiles(
filePathPrefix, namespace, shard)
if err != nil {
panic(err)
Copy link
Collaborator

Choose a reason for hiding this comment

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

don't panic here, propagate error

Copy link
Collaborator

@prateek prateek Nov 15, 2018

Choose a reason for hiding this comment

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

meh just saw its only for integration tests, w/e. feel free to leave as is.

candidateTimes := timesInRange(earliest, latest, blockSize)
return filterTimes(candidateTimes, func(t time.Time) bool {
// Snapshot anything that is unflushed.
return ns.NeedsFlush(t, t)
Copy link
Collaborator

Choose a reason for hiding this comment

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

do you need to check snapshot enabled here

Copy link
Collaborator

@prateek prateek left a comment

Choose a reason for hiding this comment

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

LGTM

@richardartoul richardartoul merged commit e92da70 into master Nov 16, 2018
@richardartoul richardartoul deleted the ra/snapshot-everything branch November 16, 2018 14:52
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.

3 participants