Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(shell-api): Account for orphan documents count in getShardDistribution() helper MONGOSH-1838 #2203

Merged
merged 24 commits into from
Oct 10, 2024

Conversation

gagik
Copy link
Contributor

@gagik gagik commented Oct 8, 2024

getShardDistribution() should correctly account orphan documents counts when calculating statistics. This count is present under the "numOrphanDocs" field in $collStats output in version (>= 6.0)

typeof extractedShardStats.storageStats.numOrphanDocs === 'number'
? extractedShardStats.storageStats.numOrphanDocs
: 0;
const ownedSize =
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gagik gagik marked this pull request as ready for review October 9, 2024 10:04
packages/shell-api/src/collection.ts Outdated Show resolved Hide resolved
packages/shell-api/src/result.ts Outdated Show resolved Hide resolved
packages/shell-api/src/result.ts Outdated Show resolved Hide resolved
@gagik gagik merged commit 2a3bb25 into main Oct 10, 2024
67 of 73 checks passed
@gagik gagik deleted the gagik/get-shard-orphan-documents branch October 10, 2024 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants