| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
collection name
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
passed in opCtx
|
| |
|
|
|
|
|
|
| |
solution
This reverts commit f8589f840c8fee60abc482d2d2c41979e356922a.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
modern 'find()' API
There are a handful of remaining callers of the legacy API,
either using the exhaust option or which are involved in a
code path which still relies on the OP_QUERY-inspired BSON
format. These should be cleaned up as follow-up work.
|
|
|
|
|
|
|
|
|
| |
The new interface uses FindCommandRequest, and avoids any
characteristics that relate specifically to the
no-longer-supported OP_QUERY wire protocol message. This
patch moves all callers of 'findOne()' onto the new API, but
more work is required to fully eliminate the old 'query()' API
from DBClientBase.
|
|
|
|
| |
previously temporarily disabled.
|
| |
|
|
|
|
| |
temporarily disabled.
|
|
|
|
|
|
|
|
|
| |
This refactor includes:
Remove dead code from 'Query' type and reduce it public interface.
Split query argument in query/update/removed methods into filter BSON and settings (which are still passed around as 'Query' type).
Remove Query(string) constructors.
Remove most callers of 'Query(const BSONObj&)'.
Replace public 'Query(const BSON&)' and 'Query.obj' with an explicit factory method and a getter.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
OP_QUERY
|
| |
|
|
|
|
| |
integration
|
| |
|
| |
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
It can go stale when we perform copy-on-write on the Collection.
Pass in current Collection where it is needed.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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).
|
|
|
|
|
|
|
|
|
|
|
|
| |
Removes ReadSource::kUnset in favor of kNoTimestamp as the default
Makes the following behavioral changes to AutoGetCollectionForRead:
* Removes special early-return handling for kNoTimestamp
* Only user or DBDirectClient operations are eligible to read at
kLastApplied.
* Operations only read at kLastApplied when in the SECONDARY state, nothing
else. This means most internal operations that use DBDirectClient do not need
to use a ReadSourceScope to ensure they read at kNoTimestamp.
|
|
|
|
|
|
| |
Most of the code should only need a const Collection now. AutoGetCollection returns a const Collection by default. There is a placeholder getWritableCollection() interface that will handle the necessary steps we need for lock free reads in the future.
Added some operators to AutoGetCollection so it behaves more like a smart pointer.
|
| |
|
| |
|
|
|
|
| |
collection cloning phase to prevent a scenario where the commit quorum cannot be satisfied due to the primary node needing the initial syncing nodes vote
|
|
|
|
|
|
|
|
|
|
|
|
| |
This redesigns user index build abort to have the following behavior:
- Take a collection X lock to stop the index build from making progress
- If we are no longer primary, return an error
- Check whether we can abort the index build (i.e. it is not already committing
or aborting)
- Delete the index catalog entry and write the abortIndexBuild oplog entry in a WUOW
- Interrupt the index builder thread
- Wait for the thread to exit
- Release locks
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Starting in 4.4, this flag is accepted by the server but
does not affect how the query is executed. However, there
were several places in the code base where 'oplogReplay'
needed to be handled due to the possibility of a mixed
version 4.2/4.4 cluster. This logic can now be removed,
since a 4.6 node need not be compatible with 4.2.
In order to avoid breaking old drivers, the 'oplogReplay'
find command option and OP_QUERY flag bit will continue to
be accepted but ignored.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Two concurrent storage transactions can now create collections with the same
collection name. These transactions will conflict at commit time; the first
committer will win and register their collection into the global catalog. The
losing transactions will bubble a WriteConflictException.
Top-level callers that should fail if the collection already existed must now
check and fail with a NamespaceExists error code. Previously, those callers
could rely on lower level code returning the NamespaceExists error.
Callers that were implicitly creating a collection may retry the operation,
using the now-registered collection.
These transaction-local collections (UncommittedCollections) are returned when
doing any CollectionCatalog::lookup* call.
|
| |
|
| |
|
| |
|
|
|
|
| |
update callback
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Segregate old-style dbtests into their own Suite initialization
system: OldStyleSuiteSpecification. This is where the funky
deprecated features can live on without interfering with the
Suite API. It also gives us a searchable base class to identify
them in the future.
OldStyleSuite has `setupTests()` and an `add<T>()` that
Suite does not have. Suite API can shrink when it doesn't
have to support these dbtest adaptor features.
Suite only needs non-template `add(name, callback)`.
- Add OldStyleSuiteInitializer to some dbtests that were missing it!
These didn't use SuiteInstance to register themselves and were
incorrect. They would self register, resulting in _allSuites()
holding a std::shared_ptr to a static-duration Suite object!
- Change `getSuite()` to return `Suite&` instead of `Suite*`.
- No more "self-registering" in Suite constructor. Registration
must be done as a separate post-construction step. This removes
some unusual lifetime management code and is easier to document.
Suite::getSuite(name) is the only way to make a Suite, and it
does the make_shared and registration calls with a pseudo-private
ConstructorEnable idiom.
- Suite->run() returns std::unique_ptr<Result> instead of
raw `Result*`. It's virtual to support OldStyleSuite behavior.
- Suite._ran does nothing. Removed.
- Result.cur does nothing. Removed.
- Switch to pass-by-value and std::move for most ctor args.
- Add explicit on 1-arg ctors.
- Get rid of TestHolder. It's just a 2-field struct.
- use fmt instead of snprintf
- TEST and TEST_F macros: generate TEST_TYPE once.
- TEST and TEST_F macros: inline the _agent variable.
- Mark _doRun as `override`.
- Terminology: replace CASE_NAME with SUITE_NAME.
- rename DeathTestImpl -> DeathTestBase
- move getDeathTestPattern into the test as a static member function
- refactor out some repetition from the comparator decl macros
- use if-constexpr and diamond relops to clean up the
ComparisonAssertion class.
- dbtests: conditionally skip some add<T> calls
- further dedup (DEATH_)TEST(_F) macros
|