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

Add support for incrementally persisting the active block in the peers bootstrapper as a snapshot #903

Merged
merged 19 commits into from
Sep 20, 2018

Conversation

richardartoul
Copy link
Contributor

@richardartoul richardartoul commented Sep 12, 2018

Addresses #900 and depends on #894

@prateek prateek changed the base branch from master to ra/commitlog-peers-v2 September 13, 2018 19:17
// SetIncremental sets whether this bootstrap should be an incremental
// that saves intermediate results to durable storage or not.
SetIncremental(value bool) RunOptions
// SetIncrementalConfig sets incremental configuration for this bootstrap.
Copy link
Collaborator

Choose a reason for hiding this comment

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

hm maybe add a Validate() here too and ensure the file set types are only ones we support?

Copy link
Collaborator

Choose a reason for hiding this comment

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

also, maybe expose a function to check supported Incremental configurations from each bootstrapper and then have the processoptions validate the configuration + bootstrappers together

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can add the validate from the first comment but I don't really understand the second comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wonder if instead of having a validate method we could just make it impossible to construct a PersistConfig incorrectly?

// that saves intermediate results to durable storage or not.
Incremental() bool
// IncrementalConfig returns the incremental configuration for this bootstrap.
IncrementalConfig() IncrementalConfig
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe time to rename this guy to PersistConfig too (talked to @robskillington, that's the best we could come up with)

@richardartoul richardartoul force-pushed the ra/incremental-peers-snapshot branch from ce64dff to 4579370 Compare September 18, 2018 14:12
@richardartoul richardartoul changed the base branch from ra/commitlog-peers-v2 to master September 18, 2018 14:12
@richardartoul richardartoul changed the title [WIP]- Add support for incrementally persisting the active block in the peers bootstrapper as a snapshot Add support for incrementally persisting the active block in the peers bootstrapper as a snapshot Sep 18, 2018
@codecov
Copy link

codecov bot commented Sep 18, 2018

Codecov Report

Merging #903 into master will increase coverage by 0.01%.
The diff coverage is 96.29%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #903      +/-   ##
==========================================
+ Coverage   78.62%   78.64%   +0.01%     
==========================================
  Files         404      404              
  Lines       34257    34286      +29     
==========================================
+ Hits        26934    26963      +29     
+ Misses       5478     5474       -4     
- Partials     1845     1849       +4
Flag Coverage Δ
#dbnode 81.53% <96.29%> (+0.05%) ⬆️
#m3ninx 75.22% <ø> (-0.08%) ⬇️
#query 67.85% <ø> (-0.1%) ⬇️
#x 84.72% <ø> (ø) ⬆️

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 0cf190d...0b378cd. Read the comment docs.

@codecov
Copy link

codecov bot commented Sep 18, 2018

Codecov Report

Merging #903 into master will increase coverage by <.01%.
The diff coverage is 91.11%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #903      +/-   ##
==========================================
+ Coverage   78.62%   78.63%   +<.01%     
==========================================
  Files         404      404              
  Lines       34257    34286      +29     
==========================================
+ Hits        26934    26960      +26     
+ Misses       5478     5475       -3     
- Partials     1845     1851       +6
Flag Coverage Δ
#dbnode 81.5% <91.11%> (+0.02%) ⬆️
#m3ninx 75.22% <ø> (-0.08%) ⬇️
#query 67.92% <ø> (-0.04%) ⬇️
#x 84.72% <ø> (ø) ⬆️

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 0cf190d...0b378cd. Read the comment docs.

defaultIncremental = false
var (
// defaultPersistConfig declares the intent to by default to perform
// a bootstrap without persistence enabled.
Copy link
Collaborator

Choose a reason for hiding this comment

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

hm you say without here but have Enabled: true below?

// the data it streamed from its peers from the commit log as soon as
// the bootstrapping process completes.
require.NoError(t, setups[1].stopServer())
startServerWithNewInspection(t, opts, setups[1])
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 reset the bootstrappers here - i.e. ensure it doesn't use peers again?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nah startServerWithNewInspection completely reconstructs the bootstrappers

@@ -1155,6 +1157,11 @@ func (s *fileSystemSource) bootstrapFromIndexPersistedBlocks(
return res, nil
}

func (s *fileSystemSource) shouldPersist(runOpts bootstrap.RunOptions) bool {
persistConfig := runOpts.PersistConfig()
return persistConfig.Enabled && persistConfig.FileSetType == persist.FileSetFlushType
Copy link
Collaborator

Choose a reason for hiding this comment

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

+1

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

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