refactor filer proto chunk variable from mtime to modified_ts_ns

This commit is contained in:
chrislu
2022-10-28 12:53:19 -07:00
parent 1e0d64c048
commit ea2637734a
29 changed files with 255 additions and 258 deletions

View File

@@ -78,7 +78,7 @@ func (pages *ChunkedDirtyPages) saveChunkedFileIntervalToStorage(reader io.Reade
pages.lastErr = err
return
}
chunk.Mtime = mtime
chunk.ModifiedTsNs = mtime
pages.fh.AddChunks([]*filer_pb.FileChunk{chunk})
pages.fh.entryViewCache = nil
glog.V(3).Infof("%v saveToStorage %s [%d,%d)", fileFullPath, chunk.FileId, offset, offset+size)

View File

@@ -124,8 +124,8 @@ func (fh *FileHandle) Release() {
}
func lessThan(a, b *filer_pb.FileChunk) bool {
if a.Mtime == b.Mtime {
if a.ModifiedTsNs == b.ModifiedTsNs {
return a.Fid.FileKey < b.Fid.FileKey
}
return a.Mtime < b.Mtime
return a.ModifiedTsNs < b.ModifiedTsNs
}