Skip to content

Improve the performance of snapshot installs by using rename#9247

Merged
briankassouf merged 16 commits into
masterfrom
raft-snapshot-perf
Jun 23, 2020
Merged

Improve the performance of snapshot installs by using rename#9247
briankassouf merged 16 commits into
masterfrom
raft-snapshot-perf

Conversation

@briankassouf
Copy link
Copy Markdown
Contributor

This PR moves the snapshot store away from using flat files to using newly written boltDB files for snapshot data. This allows us to do an atomic rename when that snapshot needs to be installed to the FSM instead of doing another copy of the data.

@briankassouf briankassouf added this to the 1.5 milestone Jun 17, 2020
@briankassouf briankassouf marked this pull request as ready for review June 18, 2020 01:15
@calvn calvn self-requested a review June 18, 2020 05:46
Comment thread physical/raft/snapshot.go Outdated
Comment thread physical/raft/snapshot.go Outdated
Comment thread physical/raft/fsm.go
Comment thread physical/raft/snapshot.go Outdated
Copy link
Copy Markdown
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

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

Changes look like they follow the RFC 👍

Comment thread physical/raft/fsm.go
Comment thread physical/raft/fsm.go
Comment thread physical/raft/snapshot.go
Comment thread physical/raft/snapshot.go
Copy link
Copy Markdown
Collaborator

@raskchanky raskchanky left a comment

Choose a reason for hiding this comment

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

Reading through all of this was very educational. Thanks for the clarifications on my questions.

Copy link
Copy Markdown
Contributor

@calvn calvn left a comment

Choose a reason for hiding this comment

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

Took another look at it, and got nothing else to add, 👍 !

Copy link
Copy Markdown
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

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

Performed another review, looks great @briankassouf. Left some minor questions & comments.

Comment thread physical/raft/fsm.go
atomic.StoreUint64(f.latestIndex, metadata.Index)
atomic.StoreUint64(f.latestTerm, metadata.Term)
f.latestConfig.Store(protoConfig)
f.latestConfig.Store(raftConfigurationToProtoConfiguration(metadata.ConfigurationIndex, metadata.Configuration))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: raftConfigToProtoConfig slightly shorter nomenclature

Comment thread physical/raft/fsm.go
Comment thread physical/raft/fsm.go Outdated
Comment thread physical/raft/snapshot.go Outdated
Comment thread physical/raft/snapshot.go
Comment thread physical/raft/snapshot.go
Comment thread physical/raft/snapshot.go Outdated
Comment thread physical/raft/snapshot.go Outdated
Comment thread physical/raft/snapshot.go Outdated
Comment thread physical/raft/snapshot.go
briankassouf and others added 2 commits June 22, 2020 10:12
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

@briankassouf briankassouf merged commit 3118ed7 into master Jun 23, 2020
@briankassouf briankassouf deleted the raft-snapshot-perf branch June 23, 2020 18:08
catsby added a commit that referenced this pull request Jun 24, 2020
* master:
  Entity and alias counts (#9262)
  Token gauge metrics implementation. (#9239)
  mfa: fix import path on test file (#9303)
  doc: update vault helm enterprise image examples (#9299)
  raft: add support for using backend for ha_storage (#9193)
  Document new and previously undocumented telemetry metrics: (#9283)
  Improve the performance of snapshot installs by using rename (#9247)
  docs: add additional info around transform for tweak and template type (#9203)
  Update CHANGELOG.md
  CL++: Add go version to server message output
andaley pushed a commit that referenced this pull request Jul 17, 2020
* initial work on improving snapshot performance

* Work on snapshots

* rename a few functions

* Cleanup the snapshot file

* vendor the safeio library

* Add a test

* Add more tests

* Some review comments

* Fix comment

* Update physical/raft/snapshot.go

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>

* Update physical/raft/snapshot.go

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>

* Review feedback

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
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.

4 participants