lib/{mergeset,storage}: make sure that getFlushToDiskDeadline() takes into account only in-memory parts

This commit is contained in:
Aliaksandr Valialkin 2023-04-13 23:17:10 -07:00
parent 2a5b9ff782
commit 550d5c7ea4
No known key found for this signature in database
GPG key ID: A72BEC6CD3D0DED1
2 changed files with 6 additions and 6 deletions

View file

@ -1168,9 +1168,9 @@ func (tb *Table) mergeParts(pws []*partWrapper, stopCh <-chan struct{}, isFinal
}
func getFlushToDiskDeadline(pws []*partWrapper) time.Time {
d := pws[0].flushToDiskDeadline
for _, pw := range pws[1:] {
if pw.flushToDiskDeadline.Before(d) {
d := time.Now().Add(dataFlushInterval)
for _, pw := range pws {
if pw.mp != nil && pw.flushToDiskDeadline.Before(d) {
d = pw.flushToDiskDeadline
}
}

View file

@ -1353,9 +1353,9 @@ func (pt *partition) mergeParts(pws []*partWrapper, stopCh <-chan struct{}, isFi
}
func getFlushToDiskDeadline(pws []*partWrapper) time.Time {
d := pws[0].flushToDiskDeadline
for _, pw := range pws[1:] {
if pw.flushToDiskDeadline.Before(d) {
d := time.Now().Add(dataFlushInterval)
for _, pw := range pws {
if pw.mp != nil && pw.flushToDiskDeadline.Before(d) {
d = pw.flushToDiskDeadline
}
}