Skip to content

Commit

Permalink
address comment 2
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinxie committed Jun 6, 2024
1 parent a689cfa commit e8c1e97
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion db/db_versioned.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func (b *BoltDBVersioned) Get(version uint64, ns string, key []byte) ([]byte, er
if err != nil {
return nil, err
}
hitLast, err = km.deleteInBetween(last, version)
hitLast, err = km.hitLastWrite(last, version)
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions db/db_versioned_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func (km *keyMeta) checkRead(version uint64) (bool, error) {
if version < km.lastVersion {
return false, nil
}
return km.deleteInBetween(km.lastVersion, version)
return km.hitLastWrite(km.lastVersion, version)
}

func (km *keyMeta) updateWrite(version uint64, value []byte) (*keyMeta, bool) {
Expand Down Expand Up @@ -130,7 +130,7 @@ func (km *keyMeta) lastDelete() uint64 {
return 0
}

func (km *keyMeta) deleteInBetween(write, read uint64) (bool, error) {
func (km *keyMeta) hitLastWrite(write, read uint64) (bool, error) {
if write > read {
panic(fmt.Sprintf("last write %d > attempted read %d", write, read))
}
Expand Down

0 comments on commit e8c1e97

Please sign in to comment.