Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the sharded time series collection.stats() integration test to account for MongoDB 9.0’s change where time series collections become “viewless”, affecting the reported timeseries.bucketsNs namespace.
Changes:
- Add a server-version-based switch to determine whether
timeseries.bucketsNsshould besystem.buckets.<coll>or the collection namespace itself. - Adjust assertions in the sharded time series
collection.stats()test to use the expected namespace.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+3419
to
+3425
| const expectedBucketsNs = isTimeseriesViewless | ||
| ? `${dbName}.${timeseriesCollectionName}` | ||
| : `${dbName}.system.buckets.${timeseriesCollectionName}`; | ||
| for (const shard of Object.values(result.shards) as any) { | ||
| expect(shard.totalSize).to.be.a('number'); | ||
| expect(shard.indexDetails).to.equal(undefined); | ||
| expect(shard.timeseries.bucketsNs).to.equal( | ||
| `${dbName}.system.buckets.${timeseriesCollectionName}` | ||
| ); | ||
| expect(shard.timeseries.bucketsNs).to.equal(expectedBucketsNs); |
| expect(result.timeseries.bucketsNs).to.equal( | ||
| `${dbName}.system.buckets.${timeseriesCollectionName}` | ||
| ); | ||
| expect(result.timeseries.bucketsNs).to.equal(expectedBucketsNs); |
Comment on lines
+3219
to
+3222
| // Server 9.0 makes timeseries collections viewless: there is no separate | ||
| // system.buckets.<coll> namespace anymore, so bucketsNs is the collection | ||
| // namespace itself. | ||
| let isTimeseriesViewless: boolean; |
Comment on lines
+3233
to
+3234
| isTimeseriesViewless = | ||
| Number.parseInt(dbVersion.split('.')[0], 10) >= 9; |
Collaborator
Author
|
better solution: #2767 |
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.
MONGOSH-3451 — linux-mlatest
MONGOSH-3473 — win32-mlatest
MONGOSH-3422 — darwin-mlatest