diff options
author | Dan Larkin-York <dan.larkin-york@mongodb.com> | 2022-11-29 17:59:13 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-11-29 19:37:46 +0000 |
commit | 7718b835c195cf408a469f2619b8d3f7533f881a (patch) | |
tree | e45e31368e995f746e46b478a20df6aba38950e8 /src/mongo/db | |
parent | dbde4d3947b1ad9e0e04f09c949117de56d9cfaa (diff) | |
download | mongo-7718b835c195cf408a469f2619b8d3f7533f881a.tar.gz |
SERVER-71562 Prevent reopening compressed buckets
Diffstat (limited to 'src/mongo/db')
-rw-r--r-- | src/mongo/db/timeseries/bucket_catalog.cpp | 4 | ||||
-rw-r--r-- | src/mongo/db/timeseries/bucket_catalog_test.cpp | 11 |
2 files changed, 10 insertions, 5 deletions
diff --git a/src/mongo/db/timeseries/bucket_catalog.cpp b/src/mongo/db/timeseries/bucket_catalog.cpp index cef4bb3a964..9039f1cca62 100644 --- a/src/mongo/db/timeseries/bucket_catalog.cpp +++ b/src/mongo/db/timeseries/bucket_catalog.cpp @@ -1428,6 +1428,10 @@ StatusWith<std::unique_ptr<BucketCatalog::Bucket>> BucketCatalog::_rehydrateBuck std::make_unique<Bucket>(bucketId, stripeNumber, key.hash, &_bucketStateManager); const bool isCompressed = timeseries::isCompressedBucket(bucketDoc); + if (isCompressed) { + // TODO (SERVER-69907): Allow opening compressed bucket + return Status{ErrorCodes::BadValue, "Reopening uncompressed buckets is not supported yet"}; + } // Initialize the remaining member variables from the bucket document. bucket->setNamespace(ns); diff --git a/src/mongo/db/timeseries/bucket_catalog_test.cpp b/src/mongo/db/timeseries/bucket_catalog_test.cpp index 3cebd456710..ef3752a9707 100644 --- a/src/mongo/db/timeseries/bucket_catalog_test.cpp +++ b/src/mongo/db/timeseries/bucket_catalog_test.cpp @@ -1249,6 +1249,7 @@ TEST_F(BucketCatalogTest, ReopenUncompressedBucketAndInsertIncompatibleMeasureme _bucketCatalog->finish(batch, {}); } +/** TODO (SERVER-69907): Re-enable these tests TEST_F(BucketCatalogTest, ReopenCompressedBucketAndInsertCompatibleMeasurement) { RAIIServerParameterControllerForTest featureFlag{"featureFlagTimeseriesScalabilityImprovements", true}; @@ -1268,8 +1269,8 @@ TEST_F(BucketCatalogTest, ReopenCompressedBucketAndInsertCompatibleMeasurement) timeseries::compressBucket(bucketDoc, _timeField, _ns1, - /*eligibleForReopening=*/false, - /*validateDecompression=*/true); + eligibleForReopening=false, + validateDecompression=true); const BSONObj& compressedBucketDoc = compressionResult.compressedBucket.value(); RAIIServerParameterControllerForTest controller{"featureFlagTimeseriesScalabilityImprovements", @@ -1333,8 +1334,8 @@ TEST_F(BucketCatalogTest, ReopenCompressedBucketAndInsertIncompatibleMeasurement timeseries::compressBucket(bucketDoc, _timeField, _ns1, - /*eligibleForReopening=*/false, - /*validateDecompression=*/true); + eligibleForReopening=false, + validateDecompression=true); const BSONObj& compressedBucketDoc = compressionResult.compressedBucket.value(); RAIIServerParameterControllerForTest controller{"featureFlagTimeseriesScalabilityImprovements", @@ -1371,7 +1372,7 @@ TEST_F(BucketCatalogTest, ReopenCompressedBucketAndInsertIncompatibleMeasurement ASSERT_EQ(batch->numPreviouslyCommittedMeasurements(), 0); _bucketCatalog->finish(batch, {}); -} +}*/ TEST_F(BucketCatalogTest, ArchivingUnderMemoryPressure) { RAIIServerParameterControllerForTest featureFlag{"featureFlagTimeseriesScalabilityImprovements", |