Skip to content

Commit

Permalink
Problem: no log version in memiavl
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed Feb 5, 2024
1 parent 0f1c1a9 commit 4982e8c
Showing 1 changed file with 4 additions and 4 deletions.
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)
} else {
opts.Logger.Info("prune snapshot, version: %d", version)
opts.Logger.Info("prune snapshot", "version", version)
}
return false, nil
}); err != nil {
Expand Down

0 comments on commit 4982e8c

Please sign in to comment.