-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
irmin-pack: assert failure, pack_index.ml, line 108 #1987
Comments
Some initial tracing through the code... scripts/yes-wallet/yes_wallet_lib.ml", line 660 (surrounding code):
Note the use of "~readonly:true". "src/lib_store/unix/store.ml", line 2675, characters 27-51 (surrounding code):
Note how in the "None" case of the "match commit_genesis", readonly is passed to Context.init... but later we will call "commit_genesis ~chain_id" which probably requires the index to be writable. So my current guess is that somehow there is a mismatch with "~readonly:true" from yes_wallet_lib.ml and the need to modify the index to add the genesis commit. |
Worth mentioning that purely within file_manager, a flush is called on a readonly index, and this causes the initial exception. So even locally there seems to be something wrong (file_manager should not call flush on a readonly index presumably). |
As of #2044 (see https://gitlab.com/tezos/tezos/-/issues/3520 for originating context on that PR) this will now throw a I'll confess I don't understand the motivation of the design of the Is there a legitimate use case for what Tezos is doing? What is the proper behavior for the batch api in this situation (ignoring readonly seems wrong to me)? @Ngoguey42 @samoht any historical context that would be useful here? |
In #1690 I planned on raising an exception in |
The batch API was initially meant to be transactional: either the batch succeeds, and everything is flushed/written on disk, or it fails, and nobody notices. This is not entirely true currently, as there are auto-flush events where some objects are flushed to disk, so if the batch is aborted, some garbage will remain. With the GC, this garbage will be reclaimed at one point, so we are good. But It's not a good idea to let the RO instance flushes data on disk (or even call |
@samoht thanks for the added context. Seems there is programmer error in our code (that we will fix) but is there also error in the tezos code that does not properly handle readonly contexts? |
From tezos-dev, devteam channel: https://tezos-dev.slack.com/archives/GB0UR34N8/p1658154805411149
The text was updated successfully, but these errors were encountered: