@ -2,11 +2,12 @@ package weed_server
import (
import (
"fmt"
"fmt"
"github.com/seaweedfs/seaweedfs/weed/stats"
"strings"
"strings"
"sync/atomic"
"sync/atomic"
"time"
"time"
"github.com/seaweedfs/seaweedfs/weed/stats"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/proto"
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/filer"
@ -62,8 +63,19 @@ func (fs *FilerServer) SubscribeMetadata(req *filer_pb.SubscribeMetadataRequest,
return nil
return nil
}
}
glog . V ( 4 ) . Infof ( "processed to %v: %v" , clientName , processedTsNs )
if processedTsNs != 0 {
if processedTsNs != 0 {
lastReadTime = log_buffer . NewMessagePosition ( processedTsNs , - 2 )
lastReadTime = log_buffer . NewMessagePosition ( processedTsNs , - 2 )
} else {
nextDayTs := util . GetNextDayTsNano ( lastReadTime . UnixNano ( ) )
position := log_buffer . NewMessagePosition ( nextDayTs , - 2 )
found , err := fs . filer . HasPersistedLogFiles ( position )
if err != nil {
return fmt . Errorf ( "checking persisted log files: %v" , err )
}
if found {
lastReadTime = position
}
}
}
glog . V ( 4 ) . Infof ( "read in memory %v aggregated subscribe %s from %+v" , clientName , req . PathPrefix , lastReadTime )
glog . V ( 4 ) . Infof ( "read in memory %v aggregated subscribe %s from %+v" , clientName , req . PathPrefix , lastReadTime )
@ -72,10 +84,7 @@ func (fs *FilerServer) SubscribeMetadata(req *filer_pb.SubscribeMetadataRequest,
fs . filer . MetaAggregator . ListenersLock . Lock ( )
fs . filer . MetaAggregator . ListenersLock . Lock ( )
fs . filer . MetaAggregator . ListenersCond . Wait ( )
fs . filer . MetaAggregator . ListenersCond . Wait ( )
fs . filer . MetaAggregator . ListenersLock . Unlock ( )
fs . filer . MetaAggregator . ListenersLock . Unlock ( )
if ! fs . hasClient ( req . ClientId , req . ClientEpoch ) {
return false
}
return true
return fs . hasClient ( req . ClientId , req . ClientEpoch )
} , eachLogEntryFn )
} , eachLogEntryFn )
if readInMemoryLogErr != nil {
if readInMemoryLogErr != nil {
if readInMemoryLogErr == log_buffer . ResumeFromDiskError {
if readInMemoryLogErr == log_buffer . ResumeFromDiskError {