Detect suspicious positional args from gflags bool flag misuse#4009
Merged
Detect suspicious positional args from gflags bool flag misuse#4009
Conversation
gflags boolean flags silently ignore space-separated values: `--flag false` sets the flag to true and orphans "false" as a positional argument. This adds a startup check that warns (or errors with --strict-flag-check) when unexpected positional arguments are found after flag parsing. Default is strict (error) for dev/CI; release config overrides to warn-only via flags.yaml.
Contributor
Author
Tracking
Standard development
CI Testing Labels
Documentation checklist
|
gflags bool flags require '=' syntax: '--flag=false', not '--flag false'. The latter silently sets the flag to true. These all happened to pass the intended value (true) so the bug was invisible.
11 tasks
Multi-line patterns like: "--data-recovery-on-startup", "false", silently set the flag to true (the opposite of intent). Use '=' syntax: "--data-recovery-on-startup=false", Affected: replication, high_availability, system_replication tests.
The previous boolean flag fix revealed that this test was accidentally running with data-recovery-on-startup=true (due to gflags treating the bare --flag as true and ignoring the space-separated "false"). Without FC and without data recovery, replicas have no mechanism to restore databases after restart. Add a data_recovery parameter to create_memgraph_instances_with_role_recovery so the wo_fc test can explicitly opt in to data recovery while other callers retain the default (false).
imilinovic
approved these changes
Apr 7, 2026
|
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.



gflags boolean flags silently ignore space-separated values:
--flag falsesets the flag to true and orphans "false" as a positional argument. This adds a startup check that warns (or errors with --strict-flag-check) when unexpected positional arguments are found after flag parsing.Default is strict (error) for dev/CI; release config overrides to warn-only via flags.yaml.