Refactor DatabaseConfiguration
- Dominant language
- C++
- Stars
- 16.7k
- Forks
- 1.6k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 126
Description
Currently there is duplicate state in DatabaseConfiguration. This makes changes to DatabaseConfiguration error-prone, since one must be careful to keep the duplicate state consistent. E.g. there was a bug recently where the order of mutations led to a different final value for `getDesiredCommitProxies()` (https://github.com/apple/foundationdb/pull/6645). Further, much of this duplicated state is public so one must look at all references to each member to reason about this instead of just needing to look at the implementation of DatabaseConfiguration.
I propose we make `DatabaseConfiguration::{applyMutation, set, clear}` the public, non-const interface and make all the member variables private.
Perhaps a pragmatic way to approach this would be to just do [this](https://github.com/apple/foundationdb/blob/f27475e2f42d2dd43149eadd0e5c82d7508e1878/fdbclient/DatabaseConfiguration.cpp#L673) after applying each mutation, or maybe lazily directly before reading a derived value if stale.
Contributor guide
Assessment
This issue has not been assessed yet.