reIndex tool - #193
Open
satebam wants to merge 7 commits into
Open
Conversation
Added documentation for the DocumentDB-Reindex tool, including requirements, installation instructions, usage, and example commands.
Updated README.md to enhance clarity and correct typos.
tmcallaghan
requested changes
Jul 16, 2026
added 3 commits
August 5, 2026 01:27
…ile and Lazy boto3 import
tmcallaghan
reviewed
Aug 18, 2026
| @@ -0,0 +1,47 @@ | |||
| # DocumentDB-Reindex | |||
|
|
|||
| In Amazon DocumentDB, high-write workloads cause index fragmentation (bloat) over time. Reindexing removes this bloat and reclaims storage. This tool identifies highly bloated indexes and provides the reindex commands to remove the bloat. | |||
Contributor
There was a problem hiding this comment.
Still need to remove mixed case of this tools directory, "reIndex-tool" should be "reindex-tool".
tmcallaghan
reviewed
Aug 18, 2026
| @@ -0,0 +1,186 @@ | |||
| import argparse | |||
Contributor
There was a problem hiding this comment.
remove mixed case, should be "reindex-script.py", not "reIndex-script.py".
tmcallaghan
reviewed
Aug 18, 2026
| --region AWS region for Secrets Manager. Defaults to us-east-1 | ||
| --unusedCollectionSizePercent Unused collection size percentage. Defaults to 30 | ||
| --workers Number of workers for reindex operation. Defaults to 2 | ||
| --tls-ca-file Path to CA file for TLS connections (e.g., global-bundle.pem) |
Contributor
There was a problem hiding this comment.
remove, if using TLS the CA file should be supplied via the URI.
tmcallaghan
reviewed
Aug 18, 2026
| else: | ||
| appConfig['connectionString'] = args.uri | ||
|
|
||
| # Append TLS CA file to URI if provided |
Contributor
There was a problem hiding this comment.
remove this argument and this code.
tmcallaghan
reviewed
Aug 18, 2026
| else: | ||
| collStats = client[thisDb['name']].command("collStats", thisColl['name']) | ||
| # Check if collection bloat exceeds the threshold | ||
| if 'unusedStorageSize' in collStats and collStats['unusedStorageSize']['unusedPercent'] >= int(appConfig['unusedCollectionSizePercent']): |
Contributor
There was a problem hiding this comment.
why is the code making the reindex decision based on the collection's unused size (percent) and not simply the bloat of each individual index?
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.
Issue #, if available:
Description of changes:
This tool helps to script out the reindex commands for the collections which are highly fragmented from the update/deletes to the Amazon DocumentDB.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.