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
Changes from 1 commit
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
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 @@ func Load(dir string, opts Options) (*DB, error) {

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)
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)
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 @@ func Load(dir string, opts Options) (*DB, error) {
}

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)
mmsqe marked this conversation as resolved.
Show resolved Hide resolved
} else {
opts.Logger.Info("prune snapshot, version: %d", version)
opts.Logger.Info("prune snapshot", "version", version)
}
return false, nil
}); err != nil {
Expand Down
Loading