void RocksSnapshotManager::setCommittedSnapshot(const SnapshotName& name) {
        stdx::lock_guard<stdx::mutex> lock(_mutex);

        uint64_t nameU64 = name.asU64();
        invariant(!_committedSnapshot || *_committedSnapshot < nameU64);
        _committedSnapshot = nameU64;
    }
 Status RocksSnapshotManager::createSnapshot(OperationContext* txn, const SnapshotName& name) {
     stdx::lock_guard<stdx::mutex> lock(_mutex);
     uint64_t nameU64 = name.asU64();
     _snapshotMap[nameU64] = std::make_shared<SnapshotHolder>(txn, nameU64);
     _snapshots.push_back(nameU64);
     return Status::OK();
 }
void WiredTigerSnapshotManager::beginTransactionAtTimestamp(SnapshotName pointInTime,
                                                            WT_SESSION* session) const {
    char readTSConfigString[15 /* read_timestamp= */ + (8 * 2) /* 8 hexadecimal characters */ +
                            1 /* trailing null */];
    auto size = std::snprintf(readTSConfigString,
                              sizeof(readTSConfigString),
                              "read_timestamp=%llx",
                              static_cast<unsigned long long>(pointInTime.asU64()));
    invariant(static_cast<std::size_t>(size) < sizeof(readTSConfigString));
    invariantWTOK(session->begin_transaction(session, readTSConfigString));
}
Exemplo n.º 4
0
Status NarkDbSnapshotManager::createSnapshot(OperationContext* txn, const SnapshotName& name) {
    auto session = NarkDbRecoveryUnit::get(txn)->getSession(txn)->getSession();
    const std::string config = str::stream() << "name=" << name.asU64();
    return narkDbRCToStatus(session->snapshot(session, config.c_str()));
}
Status WiredTigerSnapshotManager::createSnapshot(OperationContext* opCtx,
                                                 const SnapshotName& name) {
    auto session = WiredTigerRecoveryUnit::get(opCtx)->getSession(opCtx)->getSession();
    const std::string config = str::stream() << "name=" << name.asU64();
    return wtRCToStatus(session->snapshot(session, config.c_str()));
}