avoid possible metadata subscription data loss

Previous implementation append filer logs into one file. So one file is not always sorted, which can lead to miss reading some entries, especially when different filers have different write throughput.
This commit is contained in:
Chris Lu
2021-09-25 01:18:44 -07:00
parent a814f3f0a8
commit 2baed2e1e9
4 changed files with 21 additions and 7 deletions

View File

@@ -87,3 +87,11 @@ func ResolvePath(path string) string {
return path
}
func FileNameBase(filename string) string {
lastDotIndex := strings.LastIndex(filename, ".")
if lastDotIndex < 0 {
return filename
}
return filename[:lastDotIndex]
}