fix: prune cmd should disable async pruning#24090
Conversation
This comment has been minimized.
This comment has been minimized.
| store, err = iavl.LoadStoreWithInitialVersion(db, rs.logger, key, id, params.initialVersion, rs.iavlCacheSize, rs.iavlDisableFastNode, rs.metrics) | ||
| } | ||
|
|
||
| store, err := iavl.LoadStoreWithOpts(db, rs.logger, key, id, params.initialVersion, rs.iavlCacheSize, rs.iavlDisableFastNode, rs.metrics, iavltree.AsyncPruningOption(!rs.iavlSyncPruning)) |
There was a problem hiding this comment.
If this is the main place we use !rs.iavlSyncPruning should we just have an option that is rs.iavlAsyncPruning instead?
There was a problem hiding this comment.
I'm not sure what you mean
There was a problem hiding this comment.
ok dug more here, this has to do with default values. we shouldn't really ever expect anyone to set this value, and i've updated comments to reflect that here.
that means the default value false will always take effect, enabling the async behavior to be default.
in short, we want the naming of the flag to reflect what the default value implies. explicit setting of the value should only ever be done from the prune cmd. i tried thinking of other ways to set this value, but i believe this is the most straightforward, low friction way to do it.
Description
Closes: #23810
fix from #22656
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!in the type prefix if API or client breaking changeCHANGELOG.mdReviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
Please see Pull Request Reviewer section in the contributing guide for more information on how to review a pull request.
I have...