Skip to content
This repository was archived by the owner on Nov 10, 2025. It is now read-only.

Commit a50c999

Browse files
authored
Merge pull request #177 from mongodb-partners/v4.0.3
V4.0.3 fix failed cpptest
2 parents fc076ef + f6b426f commit a50c999

File tree

6 files changed

+17
-8
lines changed

6 files changed

+17
-8
lines changed

SConscript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ env.Library(
3030
'src/rocks_begin_transaction_block.cpp',
3131
'src/rocks_prepare_conflict.cpp',
3232
'src/mongo_rate_limiter_checker.cpp',
33+
'src/rocks_parameters.cpp',
3334
],
3435
LIBDEPS= [
3536
'$BUILD_DIR/mongo/base',
@@ -60,7 +61,6 @@ env.Library(
6061
source= [
6162
'src/rocks_init.cpp',
6263
'src/rocks_options_init.cpp',
63-
'src/rocks_parameters.cpp',
6464
'src/rocks_record_store_mongod.cpp',
6565
'src/rocks_server_status.cpp',
6666
],

src/rocks_engine.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,8 @@ namespace mongo {
552552
_counterManager->sync();
553553
_counterManager.reset();
554554
_compactionScheduler.reset();
555+
_defaultCf.reset();
556+
_oplogCf.reset();
555557
_db.reset();
556558
}
557559

src/rocks_engine.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,11 @@ namespace mongo {
211211
bool canRecoverToStableTimestamp() const;
212212
std::uint64_t getStableTimestamp() const;
213213
std::uint64_t getInitialDataTimestamp() const;
214+
rocksdb::ColumnFamilyHandle* getDefaultCf_ForTest() const { return _defaultCf.get(); }
215+
rocksdb::ColumnFamilyHandle* getOplogCf_ForTest() const { return _oplogCf.get(); }
216+
rocksdb::ColumnFamilyHandle* getCf_ForTest(const std::string& ns) const {
217+
return NamespaceString::oplog(ns)? getOplogCf_ForTest() : getDefaultCf_ForTest();
218+
}
214219

215220
private:
216221
Status _createIdent(StringData ident, BSONObjBuilder* configBuilder);

src/rocks_index_test.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,13 @@ namespace mongo {
6868
RocksIndexBase::generateConfig(&configBuilder, 3,
6969
IndexDescriptor::IndexVersion::kV2);
7070
if (unique) {
71-
return stdx::make_unique<RocksUniqueIndex>(_engine.getDB(), "prefix", "ident",
71+
return stdx::make_unique<RocksUniqueIndex>(_engine.getDB(), _engine.getDefaultCf_ForTest(),
72+
"prefix", "ident",
7273
_order, configBuilder.obj(),
7374
"test.rocks", "testIndex");
7475
} else {
75-
return stdx::make_unique<RocksStandardIndex>(_engine.getDB(), "prefix", "ident",
76+
return stdx::make_unique<RocksStandardIndex>(_engine.getDB(), _engine.getDefaultCf_ForTest(),
77+
"prefix", "ident",
7678
_order, configBuilder.obj());
7779
}
7880
}
@@ -81,8 +83,8 @@ namespace mongo {
8183
return stdx::make_unique<RocksRecoveryUnit>(
8284
_engine.getDB(), _engine.getOplogManager(),
8385
checked_cast<RocksSnapshotManager*>(_engine.getSnapshotManager()),
84-
_engine.getCounterManager(), _engine.getCompactionScheduler(),
85-
_engine.getDurabilityManager(), true /* durale */, _engine);
86+
_engine.getCompactionScheduler(),
87+
_engine.getDurabilityManager(), true /* durale */, &_engine);
8688
}
8789

8890
private:

src/rocks_record_store_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ namespace mongo {
8989
std::unique_ptr<RecordStore> newNonCappedRecordStore(const std::string& ns) {
9090
RocksRecoveryUnit* ru = dynamic_cast<RocksRecoveryUnit*>(_engine.newRecoveryUnit());
9191
OperationContextNoop opCtx(ru);
92-
return stdx::make_unique<RocksRecordStore>(&_engine, &opCtx, ns, "1", "prefix");
92+
return stdx::make_unique<RocksRecordStore>(&_engine, _engine.getCf_ForTest(ns), &opCtx, ns, "1", "prefix");
9393
}
9494

9595
std::unique_ptr<RecordStore> newCappedRecordStore(int64_t cappedMaxSize,
@@ -102,7 +102,7 @@ namespace mongo {
102102
int64_t cappedMaxDocs) {
103103
RocksRecoveryUnit* ru = dynamic_cast<RocksRecoveryUnit*>(_engine.newRecoveryUnit());
104104
OperationContextNoop opCtx(ru);
105-
return stdx::make_unique<RocksRecordStore>(&_engine, &opCtx, ns, "1", "prefix",
105+
return stdx::make_unique<RocksRecordStore>(&_engine, _engine.getCf_ForTest(ns), &opCtx, ns, "1", "prefix",
106106
true /* isCapped */, cappedMaxSize,
107107
cappedMaxDocs);
108108
}

src/rocks_recovery_unit_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ namespace mongo {
8989

9090
virtual std::unique_ptr<RecordStore> createRecordStore(OperationContext* opCtx,
9191
const std::string& ns) final {
92-
return stdx::make_unique<RocksRecordStore>(&_engine, opCtx, ns, "1", "prefix");
92+
return stdx::make_unique<RocksRecordStore>(&_engine, _engine.getCf_ForTest(ns), opCtx, ns, "1", "prefix");
9393
}
9494

9595
private:

0 commit comments

Comments
 (0)