| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
and there is neither collection nor view
|
|
|
|
| |
construction
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
CollectionCatalog::LifetimeMode has been removed. Catalog writes now
require that we are in an active WUOW.
Make it allowed to use WriteUnitOfWork when the server is in readOnly
mode. It does not open storage sessions, just allows registration of
RecoveryUnit callbacks that are executed when calling commit(). This
allows for the unification of code where we need to initialize Collection
instances even in readOnly mode.
Handling of enforcing readOnly has been pushed down to the RecordStore.
All interfaces that perform write now check if we are in readOnly mode
and throw if we are.
Catalog updates using the BatchedCollectionCatalogWriter class bypass
the Collection cloning if the batched CollectionCatalog instance already
has a uniquely owned copy (a previous write to this collection has been
requested). It is also not required to be in an active WUOW when the
BatchedCollectionCatalogWriter is used.
|
|
|
|
| |
instantiated
|
| |
|
|
|
|
| |
is instantiated
|
|
|
|
| |
can come in with an UNSHARDED shard version, AutoGet*LockFree can find sharded state and then pass the SV check as unsharded, due to concurrent activities with the lock-free read state setup
|
|
|
|
| |
helpers; Also enable SBE $lookup to run multi-collection locking for reads inside multi-doc transactions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When LFR is setup we should now always:
* Open a storage snapshot
* Stash the catalog
* Mark the OperationContext that we are in LFR
None of the three is done if we are not LFR.
This fixes an edge case where the opCtx was marked as LFR when no
collection was found and no snapshot or catalog was stashed. A sub op
could then stash a catalog that wasn't cleaned up properly when tearing
down. Anything that happened afterwords, like the profile logic, now had
a stashed catalog when there should be none.
Also fixed when we lock for reading on a view that we are not marking
the OperationContext to be LFR as we never opened a storage snapshot or
stashed the catalog.
|
| |
|
|
|
|
| |
AutoGetCollectionForRead* collection helpers
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
AutoGetDb::ensureDbExists()
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ReshardingOplogApplicationRules::_applyDelete_inlock() has special logic
to, upon removing a document from the temporary resharding collection,
move a document from one of the other stash collections (i.e. one
associated with a different donor shard) into its place. The
runWithTransaction() helper does so by using AlternativeSessionRegion
which will construct a separate OperationContext. The write being
performed in this separate OperationContext won't have shard version
attached for the temporary resharding collection like the original one
had. Therefore, call initializeClientRoutingVersions() on this context
to set the version.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
removed places where ns.ns() is called
changed stringdata to namespace string for lookup function
update view catalog
update view catalog test
fixed test
fixed create coll
|
| |
|
|
|
|
| |
Use AutoGetDb (and its ensureDbExists() method) instead.
|
|
|
|
| |
collections
|
| |
|
|
|
|
|
|
|
| |
1) Create a nested lock helper to run lock-free if a higher level lock-free operation is already running.
2) Change LockFreeReadsBlock to use a counter rather than a boolean to accommodate out of order lock helper destructors.
3) Only yield lock-free read state in query yield when NOT recursively locked.
4) Change query stages and plan executor to use new nested lock-free lock helper.
|
|
|
|
|
|
|
|
|
|
|
| |
CSS::getCollectionDescription() safely in AutoGetCollectionLockFree and expand lock-free sharding testing.
CollectionShardingState and DatabaseShardingState can now be accessed without a lock via new
getSharedForLockFreeReads() functions on their respective interfaces.
The shard key will now be available in the AutoGetCollection* RAII types via the CollectionPtr. This
allows lock-free reads to acquire a single view of the sharding state to use throughout a read
operation.
|
|
|
|
|
|
|
| |
get() now returns an immutable instance.
Modifications are done with static functions in the ViewCatalog that perform the update serialized by a write mutex.
Const-correct usage of the ViewCatalog.
|
|
|
|
| |
Remove LifetimeMode::kUnmanagedCommitManagedRollback it was only used here and was not correct.
|
|
|
|
|
|
|
| |
Collection in rollback handler
CollectionIndexUsageTrackerDecoration is separated from CollectionQueryInfo as they no longer have the same semantics. CollectionIndexUsageTrackerDecoration is shared between Collection instances and CollectionQueryInfo is not.
Fix UnmanagedCommitManagedRollback mode so it works when write conflict exception is thrown by managing it for rollback
|
|
|
|
| |
Collection after yielding
|
|
|
|
|
|
|
| |
copy-on-write.
Internal mutexes when reading CollectionCatalog are removed, just one mutex for writes are needed.
Lock-free reads helper AutoGetCollectionForReadLockFree stashes a CollectionCatalog consistent with snapshot on OperationContext
|
| |
|
|
|
|
| |
OperationContext in order to safely bypass RSTL lock invariants for lock-free reads.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
open a storage snapshot corresponding to the acquired Collection instance
|
|
|
|
|
|
|
|
|
|
|
| |
owned by AutoGetCollection
RequiresCollectionStage now holds a pointer to CollectionPtr owned by an AutoGetCollection.
When we save and restore the executor a new CollectionPtr pointer needs to be assigned.
Plan executors can no longer be created with temporary CollectionPtr instances and their interface have been changed to take pointers to avoid binding to rvalues.
RequiresCollectionStage no longer loads collections from the catalog and will be in sync with the owning AutoGetCollection.
|
|
|
|
|
|
|
|
| |
When a writable collection is requested from the catalog a cloned instance will be returned.
Its lifetime is managed by default in a WriteUnitOfWork and committed into the catalog in a commit handler.
In the case of a rollback the cloned and modified collection instance is simply discarded.
This removes the need to setup rollback handlers to restore any state written to a collection in the case of a rollback.
|
| |
|
|
|
|
| |
separate -LFR and non-LFR (lock-free read) lock helpers.
|
|
|
|
|
|
|
|
|
|
|
|
| |
It implements a yieldable interface that is used to re-load the
Collection pointer from the catalog after a yield that released locks.
With lock-free reads and copy-on-write on Collection instances releasing
locks without notifying an AutoGetCollection at a higher level may cause
its pointers to dangle if a MODE_X writer installs a new Collection
instance in the catalog.
CollectionPtr should be passed by const reference so a yield can notify
all the way up.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
inside a WUOW by default
There are three modes when accessing a writable Collection:
* Managed in WUOW (default)
* Unmanaged (users need to commit/rollback)
* Inplace that provides direct access to the Collection in the catalog. (Users need to ensure there's no concurrent operations going on)
Added a helper RAII type CollectionWriter that abstract the three modes above and also provides abstraction on different methods of accessing Collections (AutoGetCollection or manual lookups).
Writable Collection is aquired lazily when needed (usually inside a WUOW).
|
|
|
|
|
|
|
|
|
| |
catalog that returns collection as shared_ptr<const Collection>
AutoGetCollectionForRead and AutoGetCollectionForReadCommand now uses this and holds the shared_ptr. They return the collection as const.
Const correct various places to make this possible.
Moved some logic from Collection destructors to deregister from the catalog as they may now be destroyed at a later point.
|
| |
|
| |
|
| |
|
| |
|
| |
|