Repository navigation
Wait for positive document counts before reporting OpenSearch logs ready - #1232
Merged
mmguero merged 1 commit intoOct 13, 2026
Conversation
Merged
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.
Description
opensearch_status.sh -wcan report that logs exist when an index has an absent, null, invalid, or numeric-zero document count. The JSON branch compares the value only with the string"0"; the text fallback assumes a populated seventh column and also checks string inequality.Require a positive numeric document count in both branches. The text fallback explicitly requests
h=docs.countto avoid reading a shifted column. Keep the primary-index and distinct Arkime fallback behavior unchanged.Related issue(s)
No existing issue identified. Reproduced against upstream main at aa29d73; no overlapping open PR was found.
Type of change
How has this been tested?
python3 -m unittest discover -s scripts/installer/tests/unit -p test_opensearch_log_readiness.py -vAll six tests pass, including subcases for absent/null/zero/invalid counts, valid numeric/string counts, the no-jq fallback, and distinct Arkime index patterns. The suite runs the actual shell script and real curl/jq/awk against a loopback-only HTTP fixture; only retry sleeps are replaced. Regression cases fail on unchanged upstream because the script returns before the fixture supplies a positive count.
Bash syntax, Python compilation, Ruff correctness rules (E4/E7/E9/F), and
git diff --checkpass. Testing used macOS ARM64; no live OpenSearch cluster, credentials, or production data were involved.Documentation
Was AI used in writing the code, tests, or description for this pull request?
ChatGPT (OpenAI) generated the patch, regression tests, and this description. Desktop Commander and GitHub CLI were used to inspect the upstream code, check for duplicates, compare diffs, reproduce failures before the fix, and run the tests above. Maintainer review is pending.
Additional context
The explicit CAT column selection follows the OpenSearch CAT Indices API. No new dependencies or public endpoints are introduced.