-
Notifications
You must be signed in to change notification settings - Fork 11.4k
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
fix(sui-indexer): allow setting --gc-checkpoint-files=false #20783
Conversation
Previously I was unable to turn off checkpoint file garbage collection, since the default value was `true`, the `--gc-checkpoint-files` flag didn't expect any values and the default `clap` action was to set the value to `true` when the flag was present. I've tried all of: - `--gc-checkpoint-files 0` - `--gc-checkpoint-files false` - `--gc-checkpoint-files=0` - `--gc-checkpoint-files=false` This changes that so that the `false` value is accepted by the argument. It is based on this [comment](clap-rs/clap#1649 (comment))
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, thanks for finding this. lgtm since we're keeping the existing behavior when gc-checkpoint-files
is not set (although perhaps this was not the intention either, looking at the doc comment)
this caused a CLI issue reported at #21037 (comment) |
## Description an issue reported by community #21037 (comment) introduced in #20783 the error was ``` Argument `gc_checkpoint_files`'s selected action SetTrue contradicts `takes_value` note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ``` ## Test plan ``` DB_POOL_SIZE=10 cargo run --bin sui-indexer -- --db-url "postgres://postgres:postgrespw@localhost:5432/gegao" indexer --remote-store-url https://checkpoints.mainnet.sui.io DB_POOL_SIZE=10 cargo run --bin sui-indexer -- --db-url "postgres://postgres:postgrespw@localhost:5432/gegao" indexer --remote-store-url https://checkpoints.mainnet.sui.io --gc-checkpoint-files DB_POOL_SIZE=10 cargo run --bin sui-indexer -- --db-url "postgres://postgres:postgrespw@localhost:5432/gegao" indexer --remote-store-url https://checkpoints.mainnet.sui.io --gc-checkpoint-files=true DB_POOL_SIZE=10 cargo run --bin sui-indexer -- --db-url "postgres://postgres:postgrespw@localhost:5432/gegao" indexer --remote-store-url https://checkpoints.mainnet.sui.io --gc-checkpoint-files=false DB_POOL_SIZE=10 cargo run --bin sui-indexer -- --db-url "postgres://postgres:postgrespw@localhost:5432/gegao" indexer --remote-store-url https://checkpoints.mainnet.sui.io --gc-checkpoint-files true DB_POOL_SIZE=10 cargo run --bin sui-indexer -- --db-url "postgres://postgres:postgrespw@localhost:5432/gegao" indexer --remote-store-url https://checkpoints.mainnet.sui.io --gc-checkpoint-files false ``` --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] gRPC: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK:
Description
Previously I was unable to turn off checkpoint file garbage collection,
since the default value was
true
, the--gc-checkpoint-files
flagdidn't expect any values and the default
clap
action was to set thevalue to
true
when the flag was present. I've tried all of:--gc-checkpoint-files 0
--gc-checkpoint-files false
--gc-checkpoint-files=0
--gc-checkpoint-files=false
This changes that so that the
false
value is accepted by the argument, i.e., you can set--gc-checkpoint-files=false
. Default behavior when the argument is missing remains the same as before.It is based on this comment
Test plan
How did you test the new or updated feature?
Release notes
Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.
For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.