]> Sergey Matveev's repositories - glocate.git/commitdiff
Note about possible "out of sync"
authorSergey Matveev <stargrave@stargrave.org>
Wed, 7 Aug 2024 09:31:42 +0000 (12:31 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Wed, 7 Aug 2024 09:31:42 +0000 (12:31 +0300)
README
USAGE
main.go

diff --git a/README b/README
index 150009a3a3bd10419e829f4a0b697c0f228c6ff3c254dbeba74c6f0ce38feb78..f4cbecd5a35e12a08b1cff809379d8d49669c717e709aa91d63b5b3b609a4f59 100644 (file)
--- a/README
+++ b/README
@@ -8,9 +8,9 @@ changes to existing database.
 Why I wrote it? I have got ~18M files ZFS data storage, where even
 "find /storage" takes considerable amount of time, up to an hour.
 So I have to use separate indexed database and search against it.
-locate family of utilities does exactly that. But none of them are
+"locate" family of utilities does exactly that. But none of them are
 able to detect a few seldom made changes to the dataset, without
-traversing through the whole dataset anyway, taking much IO.
+traversing through the whole dataset anyway, consuming much IO.
 
 Fortunately ZFS design with Merkle trees is able to show us the
 difference quickly and without notable IO. "zfs diff" command's
@@ -18,7 +18,7 @@ output is very machine friendly. So locate-like utility has to be able
 to update its database with zfs-diff's output.
 
 Why this utility is so relatively complicated? Initially it kept all
-database in memory, but that took 2-3 GiBs of memory, that is huge
+database in memory, but that took 2-3 GiBs of memory, that is huge
 amount. Moreover it fully loads it to perform any basic searches. So
 current implementation uses temporary files and heavy use of data
 streaming. Database in my case takes less than 128MiB of data. And
diff --git a/USAGE b/USAGE
index fb9e732ca503e6aec42cc49fddfd0bd610bb8702229246740d46ed5262a1ec56..e9a05a0d7ed3c76280970999a0d6efd91ef14f638f628e4de27424dc77fe9742 100644 (file)
--- a/USAGE
+++ b/USAGE
@@ -45,3 +45,9 @@ snapshot and feed its diff to the command:
 
 Argument to -update is the prefix stripped from each filename of
 diff's output.
+
+Sometimes "+ and M lists are out of sync" error may be raised.
+Unfortunately you have to fix it manually. It may arise when you create
+completely new dataset and "zfs diff" shows "M"odification of its root
+directory, but there was no its "+" (creation). You can manually add "+"
+entry to the list you feed to stdin.
diff --git a/main.go b/main.go
index 39a41ab83f17f13452a1f7cf04c8e6456b1633835207b6b145426dc4d4721bea..1087f84f583064071025cb9be54614b6aaf1afd64ce06568a36537d21616692b 100644 (file)
--- a/main.go
+++ b/main.go
@@ -40,7 +40,7 @@ func (ent *Ent) IsDir() bool {
 func dbCommit(dbPath string, tmp *os.File) {
        umask := syscall.Umask(0)
        syscall.Umask(umask)
-       if err := os.Chmod(tmp.Name(), os.FileMode(0666&^umask)); err != nil {
+       if err := os.Chmod(tmp.Name(), os.FileMode(0o666&^umask)); err != nil {
                log.Fatalln(err)
        }
        if err := os.Rename(tmp.Name(), dbPath); err != nil {