refactoring
This commit is contained in:
@@ -89,7 +89,7 @@ func (b *MessageQueueBroker) GetUnflushedMessages(req *mq_pb.GetUnflushedMessage
|
||||
}
|
||||
|
||||
// Use buffer_start offset for precise deduplication
|
||||
lastFlushTsNs := localPartition.LogBuffer.LastFlushTsNs
|
||||
lastFlushTsNs := localPartition.LogBuffer.GetLastFlushTsNs()
|
||||
startBufferOffset := req.StartBufferOffset
|
||||
startTimeNs := lastFlushTsNs // Still respect last flush time for safety
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ package broker
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/seaweedfs/seaweedfs/weed/glog"
|
||||
@@ -41,14 +40,14 @@ func (b *MessageQueueBroker) genLogFlushFunc(t topic.Topic, p topic.Partition) l
|
||||
}
|
||||
}
|
||||
|
||||
atomic.StoreInt64(&logBuffer.LastFlushTsNs, stopTime.UnixNano())
|
||||
logBuffer.SetLastFlushTsNs(stopTime.UnixNano())
|
||||
|
||||
b.accessLock.Lock()
|
||||
defer b.accessLock.Unlock()
|
||||
if localPartition := b.localTopicManager.GetLocalPartition(t, p); localPartition != nil {
|
||||
localPartition.NotifyLogFlushed(logBuffer.LastFlushTsNs)
|
||||
localPartition.NotifyLogFlushed(logBuffer.GetLastFlushTsNs())
|
||||
}
|
||||
|
||||
glog.V(0).Infof("flushing at %d to %s size %d from buffer %s (offset %d)", logBuffer.LastFlushTsNs, targetFile, len(buf), logBuffer.GetName(), bufferOffset)
|
||||
glog.V(0).Infof("flushing at %d to %s size %d from buffer %s (offset %d)", logBuffer.GetLastFlushTsNs(), targetFile, len(buf), logBuffer.GetName(), bufferOffset)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user