diff --git a/CHANGELOG.md b/CHANGELOG.md index 182c210954..94c7ea326d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ * [#1720](https://github.com/crypto-org-chain/cronos/pull/1720) Include the fix of performance regression after upgrade in iavl. * [#1725](https://github.com/crypto-org-chain/cronos/pull/1725) Include the fix of deadlock when close tree in iavl. * [#1724](https://github.com/crypto-org-chain/cronos/pull/1724) Include the fix of nonce management in batch tx in ethermint. +* [#1748](https://github.com/crypto-org-chain/cronos/pull/1748) Query with GetCFWithTS to compare both timestamp and key to avoid run fixdata multiple times. + +### Improvements + +* [#1747](https://github.com/crypto-org-chain/cronos/pull/1747) Skip batch initialization and flush when fixdata with dry-run. ### State Machine Breaking @@ -24,7 +29,6 @@ ### Improvements * [#1712](https://github.com/crypto-org-chain/cronos/pull/1712) Upgrade rocksdb to `v9.8.4`. -* [#1747](https://github.com/crypto-org-chain/cronos/pull/1747) Skip batch initialization and flush when fixdata with dry-run. *Dec 2, 2024* diff --git a/versiondb/tsrocksdb/store.go b/versiondb/tsrocksdb/store.go index 68d837da8d..55810cd502 100644 --- a/versiondb/tsrocksdb/store.go +++ b/versiondb/tsrocksdb/store.go @@ -267,14 +267,14 @@ func (s Store) fixDataStore(storeName string, dryRun bool) error { realKey := cloneAppend(prefix, pair.Key) readOpts.SetTimestamp(pair.Timestamp) - oldValue, err := s.db.GetCF(readOpts, s.cfHandle, realKey) + oldValue, oldTimestamp, err := s.db.GetCFWithTS(readOpts, s.cfHandle, realKey) if err != nil { return err } - clean := bytes.Equal(oldValue.Data(), pair.Value) + clean := bytes.Equal(oldValue.Data(), pair.Value) && bytes.Equal(oldTimestamp.Data(), pair.Timestamp) oldValue.Free() - + oldTimestamp.Free() if clean { continue }