38 #include <wiredtiger.h> 40 #include "mongo/bson/ordering.h" 41 #include "mongo/bson/timestamp.h" 45 #include "mongo/stdx/functional.h" 46 #include "mongo/stdx/mutex.h" 47 #include "mongo/util/elapsed_tracker.h" 52 class JournalListener;
53 class WiredTigerRecordStore;
54 class WiredTigerSessionCache;
55 class WiredTigerSizeStorer;
61 bool shouldDowngrade(
bool readOnly,
bool repairMode,
bool hasRecoveryTimestamp);
69 const std::string& path,
71 const std::string& extraOpenOptions,
80 void setRecordStoreExtraOptions(
const std::string&
options);
81 void setSortedDataInterfaceExtraOptions(
const std::string&
options);
83 virtual bool supportsDocLocking()
const;
85 virtual bool supportsDirectoryPerDB()
const;
113 const IndexDescriptor*
desc) {
119 const IndexDescriptor*
desc) {
123 virtual Status createGroupedRecordStore(OperationContext*
opCtx,
129 virtual std::unique_ptr<RecordStore> getGroupedRecordStore(OperationContext* opCtx,
135 virtual Status createGroupedSortedDataInterface(OperationContext* opCtx,
137 const IndexDescriptor*
desc,
142 const IndexDescriptor* desc,
145 virtual Status dropIdent(OperationContext* opCtx, StringData ident);
147 virtual void alterIdentMetadata(OperationContext* opCtx,
149 const IndexDescriptor* desc);
151 virtual Status okToRename(OperationContext* opCtx,
157 virtual int flushAllFiles(OperationContext* opCtx,
bool sync);
159 virtual Status beginBackup(OperationContext* opCtx);
161 virtual void endBackup(OperationContext* opCtx);
163 virtual int64_t getIdentSize(OperationContext* opCtx, StringData ident);
165 virtual Status repairIdent(OperationContext* opCtx, StringData ident);
167 virtual bool hasIdent(OperationContext* opCtx, StringData ident)
const;
169 std::vector<std::string> getAllIdents(OperationContext* opCtx)
const;
171 virtual void cleanShutdown();
179 virtual void setStableTimestamp(Timestamp stableTimestamp)
override;
181 virtual void setInitialDataTimestamp(Timestamp initialDataTimestamp)
override;
183 virtual void setOldestTimestampFromStable()
override;
185 virtual void setOldestTimestamp(Timestamp newOldestTimestamp)
override;
187 virtual bool supportsRecoverToStableTimestamp()
const override;
191 virtual boost::optional<Timestamp> getRecoveryTimestamp()
const override;
198 virtual boost::optional<Timestamp> getLastStableCheckpointTimestamp()
const override;
200 virtual Timestamp getAllCommittedTimestamp()
const override;
202 bool supportsReadConcernSnapshot()
const final;
207 int reconfigure(
const char* str);
212 void dropSomeQueuedIdents();
213 std::list<WiredTigerCachedCursor> filterCursorsWithQueuedDrops(
214 std::list<WiredTigerCachedCursor>* cache);
215 bool haveDropsQueued()
const;
217 void syncSizeInfo(
bool sync)
const;
228 void startOplogManager(OperationContext* opCtx,
229 const std::string&
uri,
231 void haltOplogManager();
251 void replicationBatchIsComplete()
const override;
258 static void setInitRsOplogBackgroundThreadCallback(stdx::function<
bool(StringData)> cb);
266 static bool initRsOplogBackgroundThread(StringData ns);
268 static void appendGlobalStats(BSONObjBuilder& b);
270 bool isCacheUnderPressure(OperationContext* opCtx)
const override;
276 Timestamp getStableTimestamp()
const;
277 Timestamp getOldestTimestamp()
const;
283 Status _salvageIfNeeded(
const char* uri);
284 void _checkIdentPath(StringData ident);
286 bool _hasUri(WT_SESSION* session,
const std::string& uri)
const;
288 std::string _uri(StringData ident)
const;
298 Timestamp _calculateHistoryLagFromStableTimestamp(Timestamp stableTimestamp);
305 void _setOldestTimestamp(Timestamp newOldestTimestamp,
bool force);
314 std::size_t _oplogManagerCount = 0;
Definition: wiredtiger_kv_engine.cpp:250
std::string _canonicalName
Definition: wiredtiger_kv_engine.h:317
StartupVersion _startupVersion
Definition: wiredtiger_kv_engine.h:60
WT_CONNECTION * getConnection()
Definition: wiredtiger_kv_engine.h:209
Definition: kv_engine.h:53
virtual bool isEphemeral() const
Returns true if the KVEngine is ephemeral – that is, it is NOT persistent and all data is lost after...
Definition: wiredtiger_kv_engine.h:91
Definition: wiredtiger_kv_engine.cpp:206
virtual bool isDurable() const
Definition: wiredtiger_kv_engine.h:87
std::string _wtOpenConfig
Definition: wiredtiger_kv_engine.h:319
stdx::mutex _stableTimestampMutex
Definition: wiredtiger_kv_engine.h:347
Definition: wiredtiger_record_store.h:73
std::unique_ptr< WiredTigerCheckpointThread > _checkpointThread
Definition: wiredtiger_kv_engine.h:330
stdx::mutex _oplogManagerMutex
Definition: wiredtiger_kv_engine.h:313
void setJournalListener(JournalListener *jl)
Definition: dur.cpp:906
Collection *const const NamespaceString & ns
Definition: collection_info_cache_impl.cpp:53
virtual Status createRecordStore(OperationContext *opCtx, StringData ns, StringData ident, const CollectionOptions &options)
The create and drop methods on KVEngine are not transactional.
Definition: wiredtiger_kv_engine.h:97
virtual SortedDataInterface * getSortedDataInterface(OperationContext *opCtx, StringData ident, const IndexDescriptor *desc)
Definition: wiredtiger_kv_engine.h:117
Definition: collection_options.h:57
Copyright (C) 2014 MongoDB Inc.
Definition: bson_collection_catalog_entry.cpp:38
WiredTigerFileVersion _fileVersion
Definition: wiredtiger_kv_engine.h:343
ElapsedTracker _sizeStorerSyncTracker
Definition: wiredtiger_kv_engine.h:323
std::list< std::string > _identToDrop
Definition: wiredtiger_kv_engine.h:337
StartupVersion
Definition: wiredtiger_kv_engine.h:58
stdx::mutex _dropAllQueuesMutex
Definition: wiredtiger_kv_engine.h:335
OperationContext Database StringData BSONObj CollectionOptions::ParseKind bool const BSONObj &idIndex Status
Definition: database_impl.cpp:956
bool _readOnly
Definition: wiredtiger_kv_engine.h:328
const bool _inRepairMode
Definition: wiredtiger_kv_engine.h:327
bool shouldDowngrade(bool readOnly, bool repairMode, bool hasRecoveryTimestamp)
Definition: wiredtiger_kv_engine.cpp:97
ClockSource *const _clockSource
Definition: wiredtiger_kv_engine.h:310
std::string _sizeStorerUri
Definition: wiredtiger_kv_engine.h:322
std::unique_ptr< WiredTigerJournalFlusher > _journalFlusher
Definition: wiredtiger_kv_engine.h:329
Date_t _previousCheckedDropsQueued
Definition: wiredtiger_kv_engine.h:339
std::unique_ptr< WiredTigerSizeStorer > _sizeStorer
Definition: wiredtiger_kv_engine.h:321
Timestamp _oldestTimestamp
Definition: wiredtiger_kv_engine.h:350
Definition: wiredtiger_kv_engine.h:65
virtual std::unique_ptr< RecordStore > getRecordStore(OperationContext *opCtx, StringData ns, StringData ident, const CollectionOptions &options)
Having multiple out for the same ns is a rules violation; Calling on a non-created ident is invalid a...
Definition: wiredtiger_kv_engine.h:104
This class allows for the storageEngine to alert the rest of the system about journaled write progres...
Definition: journal_listener.h:48
static const KVPrefix kNotPrefixed
Definition: kv_prefix.h:47
WiredTigerSessionCache * _sessionCache
Definition: wiredtiger_prefixed_index_test.cpp:101
std::unique_ptr< WiredTigerSessionCache > _sessionCache
Definition: wiredtiger_kv_engine.h:309
WT_CONNECTION * _conn
Definition: wiredtiger_kv_engine.h:307
Definition: wiredtiger_oplog_manager.h:47
std::string _path
Definition: wiredtiger_kv_engine.h:318
Definition: index_key_validate.h:40
std::string _indexOptions
Definition: wiredtiger_kv_engine.h:333
stdx::mutex _oldestTimestampMutex
Definition: wiredtiger_kv_engine.h:346
A RecoveryUnit is responsible for ensuring that data is persisted.
Definition: recovery_unit.h:51
bool _durable
Definition: wiredtiger_kv_engine.h:325
std::unique_ptr< WiredTigerOplogManager > _oplogManager
Definition: wiredtiger_kv_engine.h:315
stdx::mutex _identToDropMutex
Definition: wiredtiger_kv_engine.h:336
std::string _rsOptions
Definition: wiredtiger_kv_engine.h:332
An abstraction used for storing documents in a collection or entries in an index. ...
Definition: record_store.h:282
WT_EVENT_HANDLER _eventHandler
Definition: wiredtiger_kv_engine.h:308
WiredTigerOplogManager * getOplogManager() const
Definition: wiredtiger_kv_engine.h:243
OperationContext Database StringData BSONObj options
Definition: database_impl.cpp:949
std::string getDowngradeString()
Definition: wiredtiger_kv_engine.cpp:143
A KVPrefix may be prepended to the keys of entries in an underlying KV store.
Definition: kv_prefix.h:44
WT_CONNECTION * _conn
Definition: wiredtiger_prefixed_index_test.cpp:100
Timestamp _stableTimestamp
Definition: wiredtiger_kv_engine.h:351
Timestamp _recoveryTimestamp
Definition: wiredtiger_kv_engine.h:342
Manages snapshots that can be read from at a later time.
Definition: snapshot_manager.h:47
WiredTigerOplogManager _oplogManager
Definition: wiredtiger_prefixed_index_test.cpp:102
virtual Status createSortedDataInterface(OperationContext *opCtx, StringData ident, const IndexDescriptor *desc)
Definition: wiredtiger_kv_engine.h:111
Collection *const OperationContext *const opCtx
Definition: collection_impl.cpp:80
bool _ephemeral
Definition: wiredtiger_kv_engine.h:326
OperationContext const IndexDescriptor * desc
Definition: index_catalog_impl.cpp:97
static const int kDefaultJournalDelayMillis
Definition: wiredtiger_kv_engine.h:67
std::unique_ptr< WiredTigerSession > _backupSession
Definition: wiredtiger_kv_engine.h:341
Definition: wiredtiger_kv_engine.h:57
std::string uri
Definition: wiredtiger_standard_record_store_test.cpp:367
SnapshotManager * getSnapshotManager() const final
Return the SnapshotManager for this KVEngine or NULL if not supported.
Definition: wiredtiger_kv_engine.h:173
This interface is a work in progress.
Definition: sorted_data_interface.h:64