Skip to content

Commit a0d77b3

Browse files
authored
Problem: need run fixdata multiple times when no timestamp checking (#1748)
* Problem: need run fixdata multiple times when no timestamp checking query with GetCFWithTS to compare both timestamp and key * cleanup * doc
1 parent b2742e2 commit a0d77b3

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
* [#1720](https://github.com/crypto-org-chain/cronos/pull/1720) Include the fix of performance regression after upgrade in iavl.
88
* [#1725](https://github.com/crypto-org-chain/cronos/pull/1725) Include the fix of deadlock when close tree in iavl.
99
* [#1724](https://github.com/crypto-org-chain/cronos/pull/1724) Include the fix of nonce management in batch tx in ethermint.
10+
* [#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.
11+
12+
### Improvements
13+
14+
* [#1747](https://github.com/crypto-org-chain/cronos/pull/1747) Skip batch initialization and flush when fixdata with dry-run.
1015

1116
### State Machine Breaking
1217

@@ -24,7 +29,6 @@
2429
### Improvements
2530

2631
* [#1712](https://github.com/crypto-org-chain/cronos/pull/1712) Upgrade rocksdb to `v9.8.4`.
27-
* [#1747](https://github.com/crypto-org-chain/cronos/pull/1747) Skip batch initialization and flush when fixdata with dry-run.
2832

2933
*Dec 2, 2024*
3034

versiondb/tsrocksdb/store.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,14 +267,14 @@ func (s Store) fixDataStore(storeName string, dryRun bool) error {
267267
realKey := cloneAppend(prefix, pair.Key)
268268

269269
readOpts.SetTimestamp(pair.Timestamp)
270-
oldValue, err := s.db.GetCF(readOpts, s.cfHandle, realKey)
270+
oldValue, oldTimestamp, err := s.db.GetCFWithTS(readOpts, s.cfHandle, realKey)
271271
if err != nil {
272272
return err
273273
}
274274

275-
clean := bytes.Equal(oldValue.Data(), pair.Value)
275+
clean := bytes.Equal(oldValue.Data(), pair.Value) && bytes.Equal(oldTimestamp.Data(), pair.Timestamp)
276276
oldValue.Free()
277-
277+
oldTimestamp.Free()
278278
if clean {
279279
continue
280280
}

0 commit comments

Comments
 (0)