// Create the database.
    ASSERT_OK(getStorageInterface()->createCollection(
        opCtx, NamespaceString("local.other"), generateOptionsWithUuid()));

    recovery.recoverFromOplog(opCtx, boost::none);
}

DEATH_TEST_F(ReplicationRecoveryTest,
             RecoveryInvariantsIfStableTimestampAndDoesNotSupportRTT,
             "Invariant failure") {
    getStorageInterfaceRecovery()->setSupportsRecoverToStableTimestamp(false);
    ReplicationRecoveryImpl recovery(getStorageInterface(), getConsistencyMarkers());
    auto opCtx = getOperationContext();

    _setUpOplog(opCtx, getStorageInterface(), {1});

    recovery.recoverFromOplog(opCtx, Timestamp(1, 1));
}

DEATH_TEST_F(ReplicationRecoveryTest, TruncateEntireOplogFasserts, "Fatal Assertion 40296") {
    ReplicationRecoveryImpl recovery(getStorageInterface(), getConsistencyMarkers());
    auto opCtx = getOperationContext();

    getConsistencyMarkers()->setOplogTruncateAfterPoint(opCtx, Timestamp(4, 4));
    getConsistencyMarkers()->setAppliedThrough(opCtx, OpTime(Timestamp(3, 3), 1));
    _setUpOplog(opCtx, getStorageInterface(), {7, 8, 9});

    recovery.recoverFromOplog(opCtx, boost::none);
}
Esempio n. 2
0
StorageInterface* StorageInterface::get(ServiceContext& service) {
    return getStorageInterface(service).get();
}
Esempio n. 3
0
void StorageInterface::set(ServiceContext* service, std::unique_ptr<StorageInterface> storage) {
    auto& storageInterface = getStorageInterface(service);
    storageInterface = std::move(storage);
}
void StorageInterface::set(ServiceContext* service, std::unique_ptr<StorageInterface> replCoord) {
    auto& coordinator = getStorageInterface(service);
    coordinator = std::move(replCoord);
}