mirage / irmin

Irmin is a distributed database that follows the same design principles as Git
https://irmin.org
ISC License
1.85k stars 157 forks source link

irmin-pack: Failure("Persisting an empty node is forbidden by the configuration of the irmin-pack store") #1965

Closed samoht closed 2 years ago

samoht commented 2 years ago

I've got an error when I'm running the tree trace with the normal default:

> dune exec -- bench/irmin-pack/tree.exe ~/Downloads/data4_10310commits.repr
+000us  application Will check commit hashes against reference.
+012us  application Starting gc on commit idx 1 with key {"Direct":["CoV8t66qHkNAfDNB7aUUqri5nqtzC72bE9Hx28u6q1C3WzMCHbkm",12801997,68]} while latest commit has idx 5001 with key {"Direct":["CoUmuqvh5jnmq83RKkwEDSJSx2LHrtGg6WsgjGdWJ7hAe9BW7iKr",47367370,103]}
+013us  application Gc ended on commit idx 5288 with key {"Direct":["CoW4DJ861ZxeS7HktLgbKACqpt9YN8GNRptpE49Et6zMFZjhjwpH",49844947,104]}, it took 81.389ms
+016us  application Starting gc on commit idx 1001 with key {"Direct":["CoVW5NgTuhyY1WkukWV3TVnKApCa4PAYqdGbbhfiJbxQ5ZoGvdvf",15006305,103]} while latest commit has idx 6001 with key {"Direct":["CoVhG4fL6GGHt6FLZWT77Mf6KjMZSnEuEk4NBfVbQXV4SY56NRsK",57150278,103]}
+017us  application Gc ended on commit idx 6122 with key {"Direct":["CoVxPLccrBpXhFyLfysnSiX8m1yDkrUZAhw11tnWecuwoUyFMvkc",58397800,103]}, it took 2.884ms
+020us  application Starting gc on commit idx 2001 with key {"Direct":["CoUzRpZkChQEPWui1jLAc9S4PnceHyCKdQFRFZD7gQ1mJvEgkC8S",20072066,102]} while latest commit has idx 7001 with key {"Direct":["CoWJ3yE6fyAScJr9GoFA3bSyRi6xef2fzqtEpG2Dbpkg4xfak2H7",67069601,103]}
+021us  application Gc ended on commit idx 7106 with key {"Direct":["CoVFKVrKAKJ9twerADxyDsA5rs1qUGH5c7rwcHayzsDZyCccgZ4m",68712888,104]}, it took 4.953ms
+024us  application Starting gc on commit idx 3001 with key {"Direct":["CoWTyuMQvUBwxpUwUkyCXypq1wNExLFSK6TFAU5d1ghCzzqkvrzf",27882982,103]} while latest commit has idx 8001 with key {"Direct":["CoUh5TojTNUiLTsdzEpGjHdAJUQZUn6WtFhCEhW3jCVfMW8Sxdsh",77901203,104]}
+025us  application Gc ended on commit idx 8143 with key {"Direct":["CoV4mNCUbpFQcshYt86XatCw2wqbCgkQTKex7vaQiykB8df2txJD",79584603,103]}, it took 6.071ms
+028us  application Starting gc on commit idx 4001 with key {"Direct":["CoVVTGhVyprzeHTJqKdGDnxtuRvQheRPdBeYGCPAFaBvutTATiXM",35654787,104]} while latest commit has idx 9001 with key {"Direct":["CoWWaJ95n9R1Q11omE4ziobL4cTQejdypeFdKBT4Mv79sQHUTk5M",88240454,104]}
+029us  application Gc ended on commit idx 9194 with key {"Direct":["CoWGvWhQ9181YiV9rW1KweMBwafZQb2GQMGZ2xSvfYLaJQHWwgRB",89949750,103]}, it took 9.846ms
+032us  application Starting gc on commit idx 5001 with key {"Direct":["CoUmuqvh5jnmq83RKkwEDSJSx2LHrtGg6WsgjGdWJ7hAe9BW7iKr",47367370,103]} while latest commit has idx 10001 with key {"Direct":["CoV6EPj3z5KuNRF95mCNSW9dMfUgA3a759PdRb1snoizgTKTUgaN",97315506,105]}
+033us  application Gc ended on commit idx 10226 with key {"Direct":["CoVKJ4mkVpBB1h1t5Ury7k7oaq2ZFYrTDR9WTxEsKJDtDp6nvFNM",99126732,104]}, it took 6.522ms
Replaying trace 10310/13315 commit 00:33 (ETA: --:--) [#############-----]  77%
+033us  application Closing repo...
+033us  application Computing summary...
Playing chain mode 0/2 commit 00:00 (ETA: --:--) [-----------------------]   0%
tree: internal error, uncaught exception:
      Failure("Persisting an empty node is forbidden by the configuration of the irmin-pack store")
      Raised at Lwt.Miscellaneous.poll in file "src/core/lwt.ml", line 3068, characters 20-29
      Called from Lwt_main.run.run_loop in file "src/unix/lwt_main.ml", line 31, characters 10-20
      Called from Lwt_main.run in file "src/unix/lwt_main.ml", line 118, characters 8-13
      Re-raised at Lwt_main.run in file "src/unix/lwt_main.ml", line 124, characters 4-13
      Called from Dune__exe__Tree.main in file "bench/irmin-pack/tree.ml", line 390, characters 4-677
      Called from Cmdliner_term.app.(fun) in file "cmdliner_term.ml", line 24, characters 19-24
      Called from Cmdliner_eval.run_parser in file "cmdliner_eval.ml", line 34, characters 37-44
tomjridge commented 2 years ago

A similar error was observed during snapshot import with minimal indexing #1830. There, I believe the problem was: snapshot import assumed the children of a node were indexed when building the parent; but the children were not indexed (minimal indexing), so the parent was constructed without any children... hence the error. Not clear to me if this is the same underlying cause.