Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem: no version in memiavl log #1311

Merged
merged 3 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- [#1302](https://github.com/crypto-org-chain/cronos/pull/1302) Fix concurrent map access in rootmulti store.
- [#1304](https://github.com/crypto-org-chain/cronos/pull/1304) Write versiondb with fsync, and relax the version requirement on startup.
- [#1308](https://github.com/crypto-org-chain/cronos/pull/1308) Update ethermint to fix duplicate cache events emitted from evm hooks and wrong priority tx.
- [#1311](https://github.com/crypto-org-chain/cronos/pull/1311) Add missing version in memiavl log.

### Improvements

Expand Down
8 changes: 4 additions & 4 deletions memiavl/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,14 @@

if snapshot != currentSnapshot {
// downgrade `"current"` link first
opts.Logger.Info("downgrade current link to %s", snapshot)
opts.Logger.Info("downgrade current link to", "snapshot", snapshot)

Check warning on line 207 in memiavl/db.go

View check run for this annotation

Codecov / codecov/patch

memiavl/db.go#L207

Added line #L207 was not covered by tests
if err := updateCurrentSymlink(dir, snapshot); err != nil {
return nil, fmt.Errorf("fail to update current snapshot link: %w", err)
}
}

// truncate the WAL
opts.Logger.Info("truncate WAL from back, version: %d", opts.TargetVersion)
opts.Logger.Info("truncate WAL from back", "version", opts.TargetVersion)

Check warning on line 214 in memiavl/db.go

View check run for this annotation

Codecov / codecov/patch

memiavl/db.go#L214

Added line #L214 was not covered by tests
if err := wal.TruncateBack(walIndex(int64(opts.TargetVersion), mtree.initialVersion)); err != nil {
return nil, fmt.Errorf("fail to truncate wal logs: %w", err)
}
Expand All @@ -223,9 +223,9 @@
}

if err := atomicRemoveDir(filepath.Join(dir, snapshotName(version))); err != nil {
opts.Logger.Error("fail to prune snapshot, version: %d", version)
opts.Logger.Error("fail to prune snapshot", "version", version, "err", err)

Check warning on line 226 in memiavl/db.go

View check run for this annotation

Codecov / codecov/patch

memiavl/db.go#L226

Added line #L226 was not covered by tests
} else {
opts.Logger.Info("prune snapshot, version: %d", version)
opts.Logger.Info("prune snapshot", "version", version)

Check warning on line 228 in memiavl/db.go

View check run for this annotation

Codecov / codecov/patch

memiavl/db.go#L228

Added line #L228 was not covered by tests
}
return false, nil
}); err != nil {
Expand Down
Loading