Skip to content

Commit 52b05be

Browse files
committed
skip the chunk data pack roll back if storing failed
1 parent 39ff4a5 commit 52b05be

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

storage/store/chunk_data_packs.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,7 @@ func (ch *ChunkDataPacks) Store(cs []*flow.ChunkDataPack) (
115115
storeChunkDataPacksFunc := func(lctx lockctx.Proof, protocolDBBatch storage.ReaderBatchWriter) error {
116116
protocolDBBatch.AddCallback(func(err error) {
117117
if err != nil {
118-
log.Warn().Err(err).Msgf("batch operation failed, rolling back stored chunk data packs for chunks: %v", cs)
119-
// Rollback the stored chunk data packs if the batch operation fails
120-
err := ch.stored.Remove(chunkDataPackIDs) // rollback stored chunk data packs on failure
121-
if err != nil {
122-
log.Fatal().Err(err).Msgf("cannot rollback stored chunk data packs") // log the error, but do not override the original error
123-
}
118+
log.Warn().Err(err).Msgf("indexing chunkID -> chunkDataPackID mapping failed, chunkDataPackIDs: %v", chunkDataPackIDs)
124119
}
125120
})
126121

0 commit comments

Comments
 (0)