Repository navigation
HBASE-30552 WALPerformanceEvaluation usage text does not match its argument parsing - #8905
arvindKandpal-ksolves wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
A moderate active issue remains because a trailing or value-less -traceFreq is accepted instead of being rejected with usage, so the change does not yet satisfy its documented argument-handling behavior.
1 open issue
What changed in this PR
Updates WALPerformanceEvaluation command-line parsing and usage text while preserving compatibility with legacy -traceFreq arguments.
Changes:
- Consume and ignore the value following -traceFreq.
- Align help and compression options in the usage output.
- Print usage when required option values are missing.
- Add regression coverage for -traceFreq 0.5.
| File | Description |
|---|---|
| hbase-diagnostics/src/test/java/org/apache/hadoop/hbase/wal/TestFSHLogProviderWithConcurrentWrites.java | Adds regression coverage for WALPerformanceEvaluation commands using the legacy -traceFreq option. |
| hbase-diagnostics/src/main/java/org/apache/hadoop/hbase/wal/WALPerformanceEvaluation.java | Updates argument parsing, missing-value handling, and command-line usage text. |
Review effort: Lite
| if (i + 1 < args.length && !args[i + 1].startsWith("-")) { | ||
| i++; | ||
| } |
There was a problem hiding this comment.
@liuxiaocs7 Thanks for the review. This is intended, so I kept the code as is.
-traceFreq has no effect since HBASE-25373, and since then a trailing -traceFreq without a value has been accepted with only a warning. This change keeps that, and only also skips a value when one is given, so older commands like "-traceFreq 0.5" work again. Rejecting a missing value for an option that is ignored would break commands that work today.
The "prints usage when a value is missing" part of the description applies to options that actually read a value, such as -threads or -roll.
|
Thanks for clarifying. I agree that a bare |
|
@liuxiaocs7 Thanks, done. The help now shows "-traceFreq []", and the next token is skipped only if it is numeric (NumberUtils.isParsable). So "-traceFreq -1" and a bare "-traceFreq" work, and "-traceFreq typo" now fails with usage. The test covers "-traceFreq 0.5", "-traceFreq -1" and a bare "-traceFreq". Also fixed a typo in the -roll usage line ("way" -> "WAL"). |

The usage text of WALPerformanceEvaluation does not match how the tool parses its arguments.
Changes:
Testing: