| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
This patch includes a number of changes to facilitate the use of PlanCacheIndexabilityState with SBE and classic plan cache keys.
* Introduced a plan cache key factory.
* Moved PlanCacheIndexabilityState from the PlanCache into CollectionQueryInfo.
* Templetized QueryPlanner::planSubqueries() so it can be used with classic and SBE plan caches.
* Removed dependency on the CanonicalQuery from the PlanCache class.
Co-authored-by: Anton Korshunov <anton.korshunov@mongodb.com>
|
| |
|
|
|
|
| |
(cherry picked from commit e312afb89845be565feac879750b78a45abd3b0c)
|
| |
|
| |
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
the collation is specified
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
After this change, the interface is sensible for both the classic
and SBE engines (with the exception of 'getRootStage()' which is left
as future work).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the master branch
This is an initial commit for the slot-based execution engine (SBE) which contains:
* Implementation of the core slot-based engine.
* The SBE stage builder, which is responsible for translating a QuerySolution tree
into an SBE plan.
* Other changes necessary for integration with the find command.
Co-authored-by: Anton Korshunov <anton.korshunov@mongodb.com>
Co-authored-by: Justin Seyster <justin.seyster@mongodb.com>
Co-authored-by: David Storch <david.storch@mongodb.com>
|
| |
|
| |
|
|
|
|
| |
This patch includes also moves ownership of the collator to the ExpressionContext.
|
|
|
|
|
|
|
|
|
|
|
|
| |
If a FETCH_STAGE encounters a record id that does not reference any
existing documents, that means either the document was deleted since
query execution encountered the index entry or their is corruption
somewhere. If the snapshot id indicates that the query has not yielded
since the time that the index entry was loaded, that leaves corruption
as the only possibility. We return and error and write to the log with
instructions on how to address potentially inconsistent data.
create mode 100644 jstests/noPassthrough/query_yields_catch_index_corruption.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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
|
|
|
|
| |
CollectionCatalog::get().lookupCollectionByNamespace()
|
| |
|
|
|
|
| |
SERVER-42157 Unowned mode for Document/Value
|
| |
|
|
|
|
|
|
| |
index corruption"
This reverts commit cf6ffa0d0b72574bf6fee66a46e1b264c0cc6d63.
|
|
|
|
| |
corruption
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Remove leading comments that are just stating the filename.
Move any file-level comments below the copyright banner.
Remove leading blank lines.
|
| |
|
| |
|
|
|
|
|
|
|
| |
keeping a Collection*.
In order to prevent COUNT stage from requiring a Collection*, splits
fast count into a new RECORD_STORE_FAST_COUNT stage.
|
| |
|
|
|
|
|
|
| |
- Removes of PlanStage::invalidate().
- Removes RecordCursor::invalidate() from the storage API.
- Removes CursorManager::invalidateDocument().
|
| |
|
| |
|
| |
|
|
|
|
| |
and document keys
|
|
|
|
|
|
|
|
|
|
|
| |
Ensures that a collection lock is held in at least MODE_IS while
deregistering a PlanExecutor from the cursor manager. Introduces new
PlanExecutor::dispose() and ClientCursor::dispose() methods that must be
called before destruction of those classes, and ensures they are called
before destruction. These calls will thread an OperationContext all the
way through to DocumentSource::dispose() for each stage in a Pipeline,
which will give DocumentSourceCursor a chance to acquire locks and
deregister its PlanExecutor if necessary.
|
| |
|
|
|
|
|
|
| |
This commit is an automated rename of all whole word instances of txn,
_txn, and txnPtr to opCtx, _opCtx, and opCtxPtr, respectively in all
.cpp and .h files in src/mongo.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
BSONObj instances should now be compared via the comparator
interface's evaluate() method. This preferred over using
BSONObj::woCompare() directly. If the comparison doesn't
require any database semantics (e.g. there is no collation),
there is a global instance of the SimpleBSONObjComparator
which should be used for BSONObj comparisons. If the
comparison requires special semantics, then callers must
instantiate their own comparator object.
|
| |
|
|
|
|
|
|
|
| |
cc().makeOperationContext().
Also, make OperationContextImpl's constructor private so that it can only be
constructed via a Client.
|
|
|
|
|
|
| |
with cc().makeOperationContext()."
This reverts commit 0ab34aa7b9c3c48ea6cf17888620fca455284d35.
|
|
|
|
|
|
|
| |
cc().makeOperationContext().
Also, make OperationContextImpl's constructor private so that it can
only be constructed via a Client.
|
| |
|
|
|
|
|
|
| |
Also renamed:
* WorkingSetMember::hasLoc() -> WorkingSetMember::hasRecordId
* WorkingSetMember::loc -> WorkingSetMember::recordId
|
|
|
|
| |
It is no longer required for other plans.
|
|
|
|
|
|
|
|
|
|
|
| |
A WorkingSetMember in the LOC_AND_OBJ state must be made owned when:
1. Its WorkingSetID is cached across multiple calls to work().
2. Multiple calls to next(), seekExact(), saveState(), etc. are
performed on the same WiredTiger cursor in a single work() call.
No longer necessary to always copy data out of WiredTiger buffers.
|