Upgrade versions of vendored libs
This commit is contained in:
10
vendor/github.com/cockroachdb/pebble/log_recycler.go
generated
vendored
10
vendor/github.com/cockroachdb/pebble/log_recycler.go
generated
vendored
@@ -32,14 +32,14 @@ type logRecycler struct {
|
||||
// the log file should not be deleted (i.e. the log is being recycled), and
|
||||
// false otherwise.
|
||||
func (r *logRecycler) add(logInfo fileInfo) bool {
|
||||
if logInfo.fileNum < r.minRecycleLogNum {
|
||||
if logInfo.fileNum.FileNum() < r.minRecycleLogNum {
|
||||
return false
|
||||
}
|
||||
|
||||
r.mu.Lock()
|
||||
defer r.mu.Unlock()
|
||||
|
||||
if logInfo.fileNum <= r.mu.maxLogNum {
|
||||
if logInfo.fileNum.FileNum() <= r.mu.maxLogNum {
|
||||
// The log file number was already considered for recycling. Don't consider
|
||||
// it again. This avoids a race between adding the same log file for
|
||||
// recycling multiple times, and removing the log file for actual
|
||||
@@ -49,7 +49,7 @@ func (r *logRecycler) add(logInfo fileInfo) bool {
|
||||
// shouldn't be deleted.
|
||||
return true
|
||||
}
|
||||
r.mu.maxLogNum = logInfo.fileNum
|
||||
r.mu.maxLogNum = logInfo.fileNum.FileNum()
|
||||
if len(r.mu.logs) >= r.limit {
|
||||
return false
|
||||
}
|
||||
@@ -89,7 +89,7 @@ func (r *logRecycler) pop(logNum FileNum) error {
|
||||
if len(r.mu.logs) == 0 {
|
||||
return errors.New("pebble: log recycler empty")
|
||||
}
|
||||
if r.mu.logs[0].fileNum != logNum {
|
||||
if r.mu.logs[0].fileNum.FileNum() != logNum {
|
||||
return errors.Errorf("pebble: log recycler invalid %d vs %d", errors.Safe(logNum), errors.Safe(fileInfoNums(r.mu.logs)))
|
||||
}
|
||||
r.mu.logs = r.mu.logs[1:]
|
||||
@@ -102,7 +102,7 @@ func fileInfoNums(finfos []fileInfo) []FileNum {
|
||||
}
|
||||
nums := make([]FileNum, len(finfos))
|
||||
for i := range finfos {
|
||||
nums[i] = finfos[i].fileNum
|
||||
nums[i] = finfos[i].fileNum.FileNum()
|
||||
}
|
||||
return nums
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user