...
The defragmenter in phase1 ("MergeAndMesure") issue dataSize commands to the shard in order to estimate the size of the chunks. Phase2 use this estimation to: - ignore all the chunks bigger than a certain threshold - order and process all the remaining chunks from the smaller to the bigger. Since we need an estimation of the data size just for smaller chunks we can avoid calculating it for the bigger ones (they will be ignored by phase 2 in any case). In order to so we could send the dataSize command with the maxSize parameter so that if the shard reach this limit it will stop scanning the index and will set the maxReached flag in the reply.
xgen-internal-githook commented on Fri, 13 Jan 2023 13:57:48 +0000: Author: {'name': 'Paolo Polato', 'email': 'paolo.polato@mongodb.com', 'username': 'ppolato'} Message: SERVER-71771 Fix overflow error in Collection Defragmentation Algorithm (cherry picked from commit daa6fb3e8fdae969996e211a2e83e1b35ef80992) Branch: v6.0 https://github.com/mongodb/mongo/commit/9f75b518e341c3e867418f16e06647ffa58bc82f xgen-internal-githook commented on Fri, 13 Jan 2023 10:25:34 +0000: Author: {'name': 'Paolo Polato', 'email': 'paolo.polato@mongodb.com', 'username': 'ppolato'} Message: SERVER-71771 Fix overflow error in Collection Defragmentation Algorithm Branch: master https://github.com/mongodb/mongo/commit/daa6fb3e8fdae969996e211a2e83e1b35ef80992 xgen-internal-githook commented on Thu, 5 Jan 2023 09:13:04 +0000: Author: {'name': 'Paolo Polato', 'email': 'paolo.polato@mongodb.com', 'username': 'ppolato'} Message: SERVER-71771 Defragmenter should cap chunk size estimation Branch: v6.0 https://github.com/mongodb/mongo/commit/3d7cb234e07f7d6e027f0c355fc6bd8aa9e1f965 xgen-internal-githook commented on Thu, 5 Jan 2023 09:01:02 +0000: Author: {'name': 'Paolo Polato', 'email': 'paolo.polato@mongodb.com', 'username': 'ppolato'} Message: SERVER-71771 Defragmenter should cap chunk size estimation Branch: master https://github.com/mongodb/mongo/commit/9ef944976420211a063f5b502e38991f0490eb65 xgen-internal-githook commented on Wed, 4 Jan 2023 10:26:39 +0000: Author: {'name': 'Paolo Polato', 'email': 'paolo.polato@mongodb.com', 'username': 'ppolato'} Message: Revert "SERVER-71771 Defragmenter should cap chunk size estimation" This reverts commit d0d9e95c07df276f4fa3cef07982803d689da5c7. Branch: master https://github.com/mongodb/mongo/commit/1eb33d31a32bb7d1a1a18e07c78239b90a9dd5d3 xgen-internal-githook commented on Thu, 29 Dec 2022 08:26:25 +0000: Author: {'name': 'Paolo Polato', 'email': 'paolo.polato@mongodb.com', 'username': 'ppolato'} Message: Revert "SERVER-71771 Defragmenter should cap chunk size estimation" This reverts commit 43221bcda3d39d58b8ef648185c63d3840791b4f. Branch: v6.0 https://github.com/mongodb/mongo/commit/6d8ebdbe466580ef90af022f5946c93608d627ad xgen-internal-githook commented on Wed, 28 Dec 2022 22:56:55 +0000: Author: {'name': 'Paolo Polato', 'email': 'paolo.polato@mongodb.com', 'username': 'ppolato'} Message: SERVER-71771 Defragmenter should cap chunk size estimation (cherry picked from commit d0d9e95c07df276f4fa3cef07982803d689da5c7) Branch: v6.0 https://github.com/mongodb/mongo/commit/1cc097075cc9531cf24a43ed249012d719b2b4fe xgen-internal-githook commented on Wed, 28 Dec 2022 17:58:24 +0000: Author: {'name': 'Paolo Polato', 'email': 'paolo.polato@mongodb.com', 'username': 'ppolato'} Message: SERVER-71771 Defragmenter should cap chunk size estimation Branch: master https://github.com/mongodb/mongo/commit/d0d9e95c07df276f4fa3cef07982803d689da5c7