Compare commits

..

1 Commits

Author SHA1 Message Date
0g-peterzhb
23aa2e43a4
Merge c8fbb13443 into 949462084a 2024-10-03 10:38:29 +00:00

View File

@ -483,9 +483,10 @@ impl LogSyncManager {
let store = self.store.clone();
let shard_config = store.get_shard_config();
let start_segment_index = tx.start_entry_index as usize / PORA_CHUNK_SIZE;
let end_segment_index =
(tx.start_entry_index as usize + bytes_to_chunks(tx.size as usize) - 1)
/ PORA_CHUNK_SIZE;
let sector_size = bytes_to_chunks(tx.size as usize);
let end_segment_index = start_segment_index
+ ((sector_size + PORA_CHUNK_SIZE - 1) / PORA_CHUNK_SIZE)
- 1;
let mut can_finalize = false;
if end_segment_index < shard_config.shard_id {
can_finalize = true;