-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add snapshot and checkpoint #216
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
Conversation
| cDb *C.rdb_t | ||
| } | ||
|
|
||
| // Release removes the snapshot from the database's list of snapshots. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment on exported method Checkpoint.Destroy should be of the form "Destroy ..."
| func (s *Store) Close() { | ||
| s.db.Close() | ||
| } | ||
| func (s *Store) Close() { s.db.Close() } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported method Store.Close should have comment or be unexported
| func (s *Store) Close() { | ||
| s.db.Close() | ||
| } | ||
| func (s *Store) Close() { s.db.Close() } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported method Store.Close should have comment or be unexported
| func (s *Store) Close() { | ||
| s.db.Close() | ||
| } | ||
| func (s *Store) Close() { s.db.Close() } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported method Store.Close should have comment or be unexported
|
|
||
| // Memtable returns the memtable size. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment on exported method Store.MemtableSize should be of the form "MemtableSize ..."
|
Review status: 0 of 6 files reviewed at latest revision, 3 unresolved discussions. rdb/checkpoint.go, line 18 at r1 (raw file):
|
| @@ -34,3 +34,7 @@ func (opts *ReadOptions) Destroy() { | |||
| func (opts *ReadOptions) SetFillCache(value bool) { | |||
| C.rdb_readoptions_set_fill_cache(opts.c, boolToChar(value)) | |||
| } | |||
|
|
|||
| func (opts *ReadOptions) SetSnapshot(snapshot *Snapshot) { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported method ReadOptions.SetSnapshot should have comment or be unexported
| @@ -34,3 +34,7 @@ func (opts *ReadOptions) Destroy() { | |||
| func (opts *ReadOptions) SetFillCache(value bool) { | |||
| C.rdb_readoptions_set_fill_cache(opts.c, boolToChar(value)) | |||
| } | |||
|
|
|||
| func (opts *ReadOptions) SetSnapshot(snapshot *Snapshot) { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported method ReadOptions.SetSnapshot should have comment or be unexported
|
Updated the API. Added some tests to illustrate how to use snapshots and checkpoints. Please see store_test.go. Review status: 0 of 8 files reviewed at latest revision, 4 unresolved discussions, some commit checks failed. Comments from Reviewable |
|
Reviewed 3 of 4 files at r1, 1 of 1 files at r2, 1 of 2 files at r3, 1 of 2 files at r5, 2 of 4 files at r6, 1 of 1 files at r7, 2 of 2 files at r8. rdb/snapshot.go, line 15 at r2 (raw file):
Does Snapshot have any APIs? Comments from Reviewable |
|
All the memory that is allocated is wrapped by Go objects, e.g., Snapshot, Checkpoint. The user is responsible for calling Close/Destroy/Release methods of these Go objects unless we want to use runtime.SetFinalizer. Right now, we don't use runtime.SetFinalizer for such wrapped C objects and I think we should be consistent about it. Thanks for the review. Review status: 7 of 8 files reviewed at latest revision, 5 unresolved discussions, some commit checks failed. rdb/snapshot.go, line 15 at r2 (raw file):
|
…ssage encoding/decoding (#216) * update SCALE to encode uint64/int64 as LE, also add encoding of common.Hash ([32]byte) type * improve p2p message encoding/decoding using updated SCALE * add getExistingStream function which checks if an existing stream is open to a peer to prevent opening another one * add ConnManager which monitors changes to connections (currently only logs opening/closing of polkadot streams)
Checkpoint is new: it is not found in RocksDB C API or gorocksdb.
This change is