Skip to content

Commit

Permalink
feat: add clean miss txn hash files request
Browse files Browse the repository at this point in the history
  • Loading branch information
raindust committed Feb 9, 2024
1 parent 44288fc commit 3385d46
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions codecs/runtime-codec/proto/persist-provider.proto
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ message PersistRequest {
ReadTxnGenesisRequest ReadTxnGenesisRequest = 22;
WriteTxnGenesisRequest WriteTxnGenesisRequest = 23;
CanTxnHashesSyncRequest CanTxnHashesSyncRequest = 24;
CleanMissTxnHashFilesRequest CleanMissTxnHashFilesRequest = 25;
}
}

Expand Down Expand Up @@ -117,6 +118,9 @@ message FindMissTxnHashFilesRequest {
int64 endTime = 2;
}

message CleanMissTxnHashFilesRequest {
}

message FindMissTxnHashFilesResponse {
repeated FileRange fileNames = 1;
}
Expand Down
2 changes: 2 additions & 0 deletions codecs/runtime-codec/src/vmh/persist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ pub trait Persist {
end_time: TimestampShort,
) -> Result<Vec<(TxnHashFileNumber, TxnHashFileNumber)>>;

fn clean_miss_txn_hash_files(&self) -> Result<()>;

fn read_txn_hash_file(&self, num: TxnHashFileNumber) -> Result<Vec<u8>>;

fn write_txn_hash_file(&mut self, num: TxnHashFileNumber, data: &[u8]) -> Result<()>;
Expand Down

0 comments on commit 3385d46

Please sign in to comment.