-
Notifications
You must be signed in to change notification settings - Fork 556
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 snapshot metadata #10121
Persist snapshot metadata #10121
Conversation
…sting the snapshot
snapshot/src/test/java/io/camunda/zeebe/snapshots/impl/FileBasedSnapshotStoreTest.java
Fixed
Show fixed
Hide fixed
snapshot/src/test/java/io/camunda/zeebe/snapshots/impl/FileBasedSnapshotStoreTest.java
Fixed
Show fixed
Hide fixed
6409903
to
d54fd98
Compare
…unkReaderTest The test was assuming lots of internal details. So it makes sense to move it to the implementation test.
…e added at the end When calculating the checksum while taking the snapshot, the metadata file is added at the end. To ensure the same semantics while verifying the checksums, we the metadata file explicitly while calculating the checksum. Otherwise, depending on the name of metadata file the checksum calculated while taking a snapshot and checksum calculated when verifying the snapshot will be different.
d54fd98
to
be38e07
Compare
@oleschoenburg This is a big PR. Let me know if you prefer it split into multiple PRs. If not I think it is best reviewed commit by commit. |
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.
Just an initial pass, I will need some more time to properly review this.
snapshot/src/main/java/io/camunda/zeebe/snapshots/impl/FileBasedSnapshotMetadata.java
Outdated
Show resolved
Hide resolved
snapshot/src/main/java/io/camunda/zeebe/snapshots/impl/FileBasedTransientSnapshot.java
Outdated
Show resolved
Hide resolved
snapshot/src/main/java/io/camunda/zeebe/snapshots/impl/FileBasedTransientSnapshot.java
Outdated
Show resolved
Hide resolved
snapshot/src/test/java/io/camunda/zeebe/snapshots/impl/FileBasedTransientSnapshotTest.java
Outdated
Show resolved
Hide resolved
snapshot/src/main/java/io/camunda/zeebe/snapshots/impl/FileBasedSnapshotStore.java
Show resolved
Hide resolved
snapshot/src/main/java/io/camunda/zeebe/snapshots/impl/FileBasedTransientSnapshot.java
Outdated
Show resolved
Hide resolved
snapshot/src/main/java/io/camunda/zeebe/snapshots/impl/SnapshotChecksum.java
Show resolved
Hide resolved
snapshot/src/main/java/io/camunda/zeebe/snapshots/impl/FileBasedSnapshot.java
Outdated
Show resolved
Hide resolved
snapshot/src/main/java/io/camunda/zeebe/snapshots/impl/FileBasedSnapshot.java
Show resolved
Hide resolved
snapshot/src/main/java/io/camunda/zeebe/snapshots/impl/FileBasedSnapshot.java
Show resolved
Hide resolved
snapshot/src/main/java/io/camunda/zeebe/snapshots/impl/FileBasedSnapshotStore.java
Outdated
Show resolved
Hide resolved
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.
Great work, @deepthidevaki 🏅
I only have minor comments, please consider them before merging.
snapshot/src/main/java/io/camunda/zeebe/snapshots/TransientSnapshot.java
Show resolved
Hide resolved
snapshot/src/main/java/io/camunda/zeebe/snapshots/impl/FileBasedSnapshotId.java
Show resolved
Hide resolved
snapshot/src/main/java/io/camunda/zeebe/snapshots/impl/FileBasedSnapshotId.java
Outdated
Show resolved
Hide resolved
5503f5b
to
1c6d09d
Compare
Thanks @oleschoenburg for the review bors merge |
Build succeeded: |
Description
FileBasedSnapshotMetadata
toFileBasedSnapshotId
FileBasedSnapshotMetadata
for the newly added metadataAsyncSnapshotDirector
updates the metadata before persisting the snapshotSnapshotChunk
. So there is no change in replication protocol. On the receiver side, it can identify if a chunk is a metadata or not from the file name. It uses this information to create the metadata object of this snapshot. The receiver is backward compatible because the older version just write the metadata file to disk as the other SnapshotChunk and just ignore it later. If the snapshot is from the older version, the receiver at new version handles this case by creating an incomplete metadata with known information. This is safe to do.Related issues
closes #10115
Definition of Done
Not all items need to be done depending on the issue and the pull request.
Code changes:
backport stable/1.3
) to the PR, in case that fails you need to create backports manually.Testing:
Documentation:
Please refer to our review guidelines.