-
Notifications
You must be signed in to change notification settings - Fork 556
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
10121: Persist snapshot metadata r=deepthidevaki a=deepthidevaki ## Description - Renamed `FileBasedSnapshotMetadata` to `FileBasedSnapshotId` - Created a new `FileBasedSnapshotMetadata` for the newly added metadata - `AsyncSnapshotDirector` updates the metadata before persisting the snapshot - While persisting the snapshot, metadata is written as a file in snapshot's directory and the checksum is updated to include this file - The metadata file is replicated as a `SnapshotChunk`. 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. - Added new tests and refactored existing test to make it work with the new semantics. ## Related issues closes #10115 Co-authored-by: Deepthi Devaki Akkoorath <deepthidevaki@gmail.com>
- Loading branch information
Showing
26 changed files
with
599 additions
and
373 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
snapshot/src/main/java/io/camunda/zeebe/snapshots/SnapshotMetadata.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH under | ||
* one or more contributor license agreements. See the NOTICE file distributed | ||
* with this work for additional information regarding copyright ownership. | ||
* Licensed under the Zeebe Community License 1.1. You may not use this file | ||
* except in compliance with the Zeebe Community License 1.1. | ||
*/ | ||
package io.camunda.zeebe.snapshots; | ||
|
||
public interface SnapshotMetadata { | ||
|
||
/** | ||
* @return version of the snapshot | ||
*/ | ||
int version(); | ||
|
||
/** | ||
* @return processed position in the snapshot (same as in SnapshotId) | ||
*/ | ||
long processedPosition(); | ||
|
||
/** | ||
* @return exported position in the snapshot (same as in SnapshotId) | ||
*/ | ||
long exportedPosition(); | ||
|
||
/** | ||
* A snapshot is only valid if the logstream consists of the events from the processedPosition up | ||
* to the followup event position. | ||
* | ||
* @return position of the last followUpEvent that must be in the logstream to ensure that the | ||
* system can recover from the snapshot and the logstream. | ||
*/ | ||
long lastFollowupEventPosition(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.