-
Notifications
You must be signed in to change notification settings - Fork 34
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
Do not require the mithril client to create the DB directory #1572
Comments
Thanks @TrevorBenson for creating this issue. In order to avoid breaking changes in the client CLI, we could also support a new option like |
Yes, additional parameters would be acceptable to achieve the expected behavior. |
Hi @TrevorBenson, thanks for the issue. After rethinking a bit about this issue as a team, we decided to just accept existing, but empty, This behavior is implemented in #1581 that we can merge as soon as today if it's alright for you. |
This sounds perfectly acceptable. Thank you |
Why
When mithril-client CLI is instructed to
snapshot download
it expects to be able to create the db directory inside the--download-dir
which points to the parent directory instead of the db directory where the download actually occurs. When the db directory already exists it results in an error.At first glance this seems simple to resolve, just remove the directory. However, this is opinionated behavior limits the node operators choices and can lead to unnecessary complications, changes to file system layouts, even failures in some designs.
When a node operator:
For a basic POC of the issue a bare metal reproduction scenario is provided:
Steps to reproduce
/cardano/db
mithril-client --aggregator-endpoint $AGGREGATOR_ENDPOINT snapshot download --genesis-verification-key $GENESIS_VERIFICATION_KEY --download-dir /cardano
Error: Unpack directory '/cardano/db' already exists, please move or delete it.
rmdir /cardano/db
rmdir: failed to remove '/cardano/db': Device or resource busy
While this is only bare metal, in most of the mentioned cases it is essentially not viable to simply
rmdir /path/to/db
and let the Mithril client create the directory. While at first glance this may seem simple, just make the mount point the parent directory, this leads to other complications when the db directory or it's parent directory:Workarounds to these issues don't only result in unwanted file system layouts, but can result in requiring additional IO after the download to relocate the data when separate file systems are required, which can also lead to double the required storage being available. Separate than this it can create unwanted dependency relationships which eventually lead to other issues.
I filed this as a feature request, but the opinionated nature of this design choice I feel comes close to what I would define as a bug or flaw in the design due to the unnecessary requirements it may impose on node operators integrating mithril into existing designs which may have been in use for multiple years without changes.
What
This could be achieved just by removing the requirement to create the directory when it is empty. Or having the
--download-dir
target the actual db directory instead of its parent directory, and is required to be empty.The text was updated successfully, but these errors were encountered: