-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Replication
-
Fully Compatible
-
Repl 2023-04-17
The FCV constants (such as multiversion::FeatureCompatibilityVersion::kVersion_6_0, etc) should not generally not be used in FCV checks like this (i.e. with the isLessThan, isGreaterThan, isLessThanOrEqualTo, isGreaterThanOrEqualTo functions)
We can either do this by making the FCV constants private (preferred) We cannot do this because the FeatureCompatibilityVersion class (not the constants themselves) is used elsewhere, example: https://github.com/mongodb/mongo/blob/c8bfab6325363f696e628ddafaf40df921526560/src/mongo/db/commands/feature_compatibility_version_parser.cpp#L45)
The other option is we can add a linter to ban additional usages or fail compile when an FCV is used as part of a check.
If we add a linter we can consider adding it as a rule in clang-tidy (parsing the C++ AST instead of doing string search, similar to what jstestfuzz does for JavaScript). Another related suggestion is that instead of/in addition to the existing future git tag variant that runs everything, we could extend the clang-tidy rule to change the generic FCV references and remaining explicit FCV checks to use the new FCV (or even fuzz the fcv version)
- depends on
-
SERVER-66728 Remove Old 5.x FCV Constants
- Blocked
-
SERVER-66923 Remove kFullyDowngradedTo_5_0 constants in the codebase
- Closed
-
SERVER-67235 Change references in pipeline_d.cpp to kVersion_6_0 to use isEnabled
- Closed
-
SERVER-67237 Remove FCV constant in document_source_list_catalog.cpp
- Closed
-
SERVER-67444 Eliminate legacy `requestMoveChunk` call from `Balancer::_moveChunks`
- Closed
- is depended on by
-
SERVER-60213 Standardize when to use and remove feature flags in the lifecycle of a project
- Closed
- is duplicated by
-
SERVER-67243 Add a linter to server_options.h FCV helpers to enforce that they are only used in generic FCV checks
- Closed
-
SERVER-61967 Ban usages of transitionary FCVs in FCV checks
- Closed
- related to
-
SERVER-61967 Ban usages of transitionary FCVs in FCV checks
- Closed