AWS documentdb documentation change
Summary
Added new section about database index bloat including causes, detection method using $indexStats, and mitigation through reIndex command
Security assessment
The changes document performance/maintenance considerations around index storage bloat rather than addressing security vulnerabilities. While index bloat could theoretically impact resource utilization, there's no mention of security exploits, vulnerabilities, or access control issues in the diff.
Diff
diff --git a/documentdb/latest/developerguide/troubleshooting.index-creation.md b/documentdb/latest/developerguide/troubleshooting.index-creation.md index ec6909439..0213cf2f1 100644 --- a//documentdb/latest/developerguide/troubleshooting.index-creation.md +++ b//documentdb/latest/developerguide/troubleshooting.index-creation.md @@ -5 +5 @@ -Index build fails Background index build latency issues and fails +Index build fails Background index build latency issues and failsIndex bloat @@ -7 +7 @@ Index build fails Background index build latency issues and fails -# Troubleshooting index creation +# Troubleshooting indexes @@ -16,0 +17,2 @@ The following topics address what to do if your index or background index build + * Database index bloat + @@ -35,0 +38,41 @@ Amazon DocumentDB allows only one background index build to occur on a collectio +## Database index bloat + +Amazon DocumentDB uses Multi-Version Concurrency Control (MVCC) to manage concurrent transactions. When documents are deleted or updated, their previous versions remain in collections and indexes as "dead" versions. The garbage collection process automatically reclaims space from these dead versions for future operations. + +Index bloat occurs when a collection's indexes become larger due to the accumulation of dead or obsolete index entries or fragmentation within the pages. The percentage reported represents the amount of index space that can be used by future index entries. This bloat consumes space in both the buffer cache and storage. If you want to remove the bloat, you will need to rebuild indexes. + +###### Example + +Run the following command to determine unused storage for your index: + + + db.coll.aggregate({$indexStats:{}}); + +The result looks similar to this: + + + { + "name" : "_id_", + "key" : { + "_id" : 1 + }, + "host" : "devbox-test.localhost.a2z.com:27317", + "size" : NumberLong(827392), + "accesses" : { + "ops" : NumberLong(40000), + "docsRead" : NumberLong(46049), + "since" : ISODate("2025-04-03T21:44:51.251Z") + }, + "cacheStats" : { + "blksRead" : NumberLong(264), + "blksHit" : NumberLong(140190), + "hitRatio" : 99.8121 + }, + "unusedStorageSize" : { + "unusedSizeBytes" : 409600, + "unusedSizePercent" : 49.51 + } + } + +You can rebuild indexes without downtime using the `reIndex` command, which requires a scan of the entire collection. See [Index maintenance using reIndex](./managing-indexes.html#reIndex). +