fix(store/v2): error info maybe covered by err = batch.Close() (#21727)

Co-authored-by: Julien Robert <julien@rbrt.fr>
Co-authored-by: Marko <marko@baricevic.me>
This commit is contained in:
lfz941
2024-09-17 09:21:01 +00:00
committed by GitHub
co-authored by Julien Robert Marko
parent 3314cfb899
commit 6aaa935019
+4 -1
View File
@@ -113,7 +113,10 @@ func (m *MetadataStore) flushCommitInfo(version uint64, cInfo *proof.CommitInfo)
func (m *MetadataStore) flushRemovedStoreKeys(version uint64, storeKeys []string) (err error) {
batch := m.kv.NewBatch()
defer func() {
err = batch.Close()
cErr := batch.Close()
if err == nil {
err = cErr
}
}()
for _, storeKey := range storeKeys {