Repository navigation
fixup issues. - #1483
Merged
Merged
fixup issues.#1483
Conversation
…core_diff, default_store_region_size) - balance_region_limit_score_diff: register a strictly-positive gflags validator so it can be changed at runtime via brpc /flags. - balance_region_default_store_region_size: new int64 gflag that overrides the config file value when > 0 (0 keeps the config-file semantics); ConfigHelper getter widened to int64 so overrides beyond 2GB work. - Wire both knobs into the coordinator ControlConfig whitelist via new Helper::HandleInt64/HandleDoubleControlConfigVariable, mirroring the bool handler contract (query mode, invalid value sets is_error_occurred and keeps the flag, identical value sets is_already_set). - Unit tests cover getter precedence (flag > config > built-in 256MB), the two handler contracts, and validator rejection of nonsense values. Neither value is persisted: a coordinator restart falls back to the config file / built-in default, matching every existing ControlConfig variable.
…per bound OpenReaderAdaptor and ContextReset built iter_options with the region's encoded range but passed a default-constructed IteratorOptions() to NewIterator, so no iterate_upper_bound was ever set; the read loop also never checked the upper bound. As a result an InstallSnapshot streamed every key >= the region's start_key to the end of the CF, sending other regions' data to the follower (region_size 0.2GB -> 426GB snapshots in production; new replicas polluted with cross-region keys). Pass the prepared iter_options at both call sites and add an explicit upper-bound guard (empty-safe) in the read loop. Verified on a 5-store local cluster: - head-of-CF region 80001: 24,754,030 B / 938 keys -> 1,061,991 B / 237 keys (23.3x), sst_dump shows 0 cross-region keys (was 320) - mid-chain region 80002: 20,991,640 B, own data only (was own+2.6MB) - CF-tail region 80005: 1,977,970 B, byte-identical before/after (no self-truncation)
HandleInt64/HandleDoubleControlConfigVariable assigned the gflag variable directly, which gflags documents as bypassing registered validators: only command-line parsing and SetCommandLineOption run them. The brpc /flags path was therefore guarded while the coordinator ControlConfig RPC could inject values the validators exist to reject -- strtod happily parses "0", "-3", "inf" and "nan" for balance_region_limit_score_diff (NaN defeats the score-diff comparison, +inf silently disables balancing) and strtoll accepts negative sizes for balance_region_default_store_region_size. Apply values through google::SetCommandLineOption so validators run and unknown flag names are reported instead of silently mutating the passed variable; reject non-finite doubles up front for a clear error; tighten ValidatePositiveDouble with std::isfinite since "inf" > 0 would pass it. Tests: RPC-path rejection cases for 0/-3/inf/-inf/nan/nan(123)/-1 and an unknown-flag case (all red before this fix -- the injected NaN even leaked into later DynamicGflagsTest runs); /flags-path inf/nan cases for the tightened validator.
ad175ae3 said "Remove useless log" but only commented the two lines out; delete them for real. No behavior change -- time_info and perf summary population are untouched.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.