.. meta:: :robots: noindex, nosnippet ============================= Release Notes for MongoDB 4.4 ============================= .. default-domain:: mongodb .. contents:: On this page :local: :backlinks: none :depth: 1 :class: twocols .. warning:: Past Release Limitations .. include:: /includes/release-notes/critical-warning-text.rst .. list-table:: :header-rows: 1 * - Issue - Affected Versions * - :issue:`WT-7426` - 4.4.5 * - :issue:`WT-7984` - 4.4.8 * - :issue:`WT-7995` - 4.4.2 - 4.4.8 * - :issue:`WT-10461` - 4.4.0 - 4.4.18 (ARM64 or POWER system architectures) * - :issue:`WT-10551` - 4.4.8 - 4.4.21 (Incremental backups on Ops Manager or Cloud Manager clusters) * - :issue:`SERVER-58936` - 4.4.7 Patch Releases -------------- .. _4.4.29-release-notes: 4.4.29 - Feb 28, 2024 ~~~~~~~~~~~~~~~~~~~~~ .. |cve-version-list| replace:: MongoDB 4.4 prior to 4.4.29 .. include:: /includes/security/cve-2024-1351-info.rst - :issue:`SERVER-70155` Add duration of how long an oplog slot is kept open to mongod "Slow query" log lines - :issue:`SERVER-82353` Multi-document transactions can miss documents when movePrimary runs concurrently - :issue:`SERVER-83564` Make sure the process field is indexed in config.locks - :issue:`SERVER-85536` [4.4] removing unindexed unique partial index entries generates write conflicts - `All JIRA issues closed in 4.4.29 `_ - :ref:`4.4.29-changelog` .. _4.4.28-release-notes: 4.4.28 - Jan 18, 2024 ~~~~~~~~~~~~~~~~~~~~~ - :issue:`SERVER-77506` Sharded multi-document transactions can mismatch data and ShardVersion - :issue:`SERVER-82365` Optimize the construction of the balancer's collection distribution status histogram (2nd attempt) - :issue:`SERVER-82883` Recovering TransactionCoordinator on stepup may block acquiring read/write tickets while participants are in the prepared state - :issue:`WT-7929` Investigate a solution to avoid FTDC stalls during checkpoint - `All JIRA issues closed in 4.4.28 `_ - :ref:`4.4.28-changelog` .. _4.4.27-release-notes: 4.4.27 - Jan 3, 2024 ~~~~~~~~~~~~~~~~~~~~ - :issue:`SERVER-63865` Handle missing index idents during standalone startup recovery after unclean shutdown - :issue:`SERVER-81106` Recipient shard doesn't wait for the collection version to be locally persisted before starting the cloning phase - :issue:`SERVER-81878` startupRecoveryForRestore may not play nicely with collection drop applied during startup recovery - :issue:`SERVER-82325` Config server could invariant during balancer round - :issue:`WT-11564` Fix RTS to read the newest transaction value only when it exists in the checkpoint - `All JIRA issues closed in 4.4.27 `_ - :ref:`4.4.27-changelog` .. _4.4.26-release-notes: 4.4.26 - Nov 27, 2023 ~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-50792` Return more useful errors when a shard key index can't be found for shardCollection or refineCollectionShardKey - :issue:`SERVER-80021` Make $convert round-trip correctly between double and string - :issue:`SERVER-81106` Recipient shard doesn't wait for the collection version to be locally persisted before starting the cloning phase - :issue:`SERVER-81966` Avoid modification of previous ChunkMap instances during refresh - :issue:`WT-10424` cursor::search_near slow performance if many deleted items are present - `All JIRA issues closed in 4.4.26 `_ - :ref:`4.4.26-changelog` .. _4.4.25-release-notes: 4.4.25 - Sep 29, 2023 ~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-76299` Report writeConflicts in serverStatus on secondaries - :issue:`SERVER-78828` LDAP host timing data can be inconsistent during sorting - :issue:`WT-11031` Fix RTS to skip tables with no time window information in the checkpoint - :issue:`SERVER-70973` Balancer should stop iterating collections when there are no more available shards - :issue:`SERVER-71627` Refreshed cached collection route info will severely block all client request when a cluster with 1 million chunks - :issue:`SERVER-78813` Commit point propagation fails indefinitely with exhaust cursors with null lastCommitted optime - :issue:`WT-8570` Do not increase oldest ID during recovery - :issue:`WT-10449` Do not save update chain when there are no updates to be written to the history store - `All JIRA issues closed in 4.4.25 `_ - :ref:`4.4.25-changelog` .. _4.4.24-release-notes: 4.4.24 - Aug 23, 2023 ~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-76299` Report writeConflicts in serverStatus on secondaries - :issue:`SERVER-78828` LDAP host timing data can be inconsistent during sorting - :issue:`WT-11031` Fix RTS to skip tables with no time window information in the checkpoint - `All JIRA issues closed in 4.4.24 `_ - :ref:`4.4.24-changelog` .. _4.4.23-release-notes: 4.4.23 - Jul 13, 2023 ~~~~~~~~~~~~~~~~~~~~~ - :issue:`SERVER-73943` Pin code pages in memory in memory constrained systems - :issue:`SERVER-75922` Partial unique indexes created on MongoDB 4.0 can be missing index keys after upgrade to 4.2 and later, leading to uniqueness violations - :issue:`SERVER-78126` For specific kinds of input, mongo::Value() always hashes to the same result on big-endian platforms - `All JIRA issues closed in 4.4.23 `_ - :ref:`4.4.23-changelog` .. _4.4.22-release-notes: 4.4.22 - May 18, 2023 ~~~~~~~~~~~~~~~~~~~~~ - :issue:`SERVER-48196` Upgrade the timelib to the latest to update the built-in timezone files to the latest - :issue:`SERVER-57056` Syslog severity set incorrectly for INFO messages - :issue:`WT-10551` Incremental backup may omit modified blocks - `All JIRA issues closed in 4.4.22 `_ - :ref:`4.4.22-changelog` .. _4.4.21-release-notes: 4.4.21 - April 27, 2023 ~~~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-75261` "listCollections" command fails with BSONObjectTooLarge error - :issue:`SERVER-76098` Allow queries with $search and non-simple collations - `All JIRA issues closed in 4.4.21 `_ - :ref:`4.4.21-changelog` .. _4.4.20-release-notes: 4.4.20 - Apr 10, 2023 ~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-51835` Mongos readPreferenceTags are not working as expected - :issue:`SERVER-74345` mongodb-org-server 4.4.19, 5.0.15, 6.0.5 not starting after upgrading from older version (Debian, RPM Packages) - :issue:`SERVER-75205` Deadlock between stepdown and restoring locks after yielding when all read tickets exhausted - :issue:`WT-9500` Fix RTS to use cell time window instead of key/value timestamps of HS update - `All JIRA issues closed in 4.4.20 `_ - :ref:`4.4.20-changelog` .. _4.4.19-release-notes: 4.4.19 - Feb 27, 2023 ~~~~~~~~~~~~~~~~~~~~~ .. warning:: .. |broken-version| replace:: 4.4.19 .. include:: /includes/release-notes/warning-text-server-upgrade.rst Issues fixed: - :issue:`SERVER-68122` Investigate replicating the collection WiredTiger config string during initial sync - :issue:`SERVER-71759` dataSize command doesn't yield - :issue:`SERVER-72222` MapReduce with single reduce optimization fails when merging results in sharded cluster - :issue:`SERVER-72535` Sharded clusters allow creating the 'admin', 'local', and 'config' databases with alternative casings - :issue:`SERVER-70235` Don't create range deletion documents upon v4.2-v4.4 upgrade in case of collection uuid mismatch - :issue:`WT-9599` Acquire the hot backup lock to call fallocate in the block manager - `All JIRA issues closed in 4.4.19 `_ - :ref:`4.4.19-changelog` 4.4.18 - Nov 21, 2022 ~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-66289` $out incorrectly throws BSONObj size error on v5.0.8 - :issue:`SERVER-61185` Use prefix_search for unique index lookup - :issue:`SERVER-68115` Bug fix for "elemMatchRootLength > 0" invariant trigger - :issue:`SERVER-50454` Avoiding sending the "keyValue" field to drivers on duplicate key error - :issue:`SERVER-69443` [4.4] Allow speculative majority reads in multi-doc txns when --enableMajorityReadConcern=false - `All JIRA issues closed in 4.4.18 `_ - :ref:`4.4.18-changelog` .. _4.4.17-release-notes: 4.4.17 - Sep 28, 2022 ~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-68925` Reintroduce check table logging settings at startup (revert :issue:`SERVER-43664`) - :issue:`SERVER-56127` Retryable update may execute more than once if chunk is migrated and shard key pattern uses nested fields - :issue:`SERVER-64142` Add new enforceUniqueness to refineCollectionShardKey command - :issue:`SERVER-65382` AutoSplitVector should not use clientReadable to reorder shard key fields - :issue:`SERVER-61275` Destruct the size storer after the session cache has shutdown - :issue:`WT-9870` Fix updating pinned timestamp whenever oldest timestamp is updated during recovery - `All JIRA issues closed in 4.4.17 `_ - :ref:`4.4.17-changelog` .. _4.4.16-release-notes: 4.4.16 - Aug 19, 2022 ~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-67302` "Reading from replicated collection without read timestamp or PBWM lock" crash with clock changes - :issue:`SERVER-61321` Improve handling of large/NaN values for text index version - :issue:`SERVER-60607` Improve handling of large/NaN values for geo index version - :issue:`SERVER-66418` Bad projection created during dependency analysis due to string order assumption - :issue:`WT-9096` Fix search near returning wrong key/value sometimes when key doesn't exist - `All JIRA issues closed in 4.4.16 `_ - :ref:`4.4.16-changelog` .. _4.4.15-release-notes: 4.4.15 - Jun 21, 2022 ~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-66433` Backport deadline waiting for overlapping range deletion to finish to pre-v5.1 versions - :issue:`SERVER-65821` Deadlock during setFCV when there are prepared transactions that have not persisted commit/abort decision - :issue:`SERVER-65131` Disable opportunistic read targeting (except for hedged reads) - :issue:`SERVER-62272` Adding schema validation to a collection can prevent chunk migrations of failing documents - :issue:`SERVER-54900` Blocking networking calls can delay sync-source resolution indefinitely - `All JIRA issues closed in 4.4.15 `_ - :ref:`4.4.15-changelog` .. _4.4.14-release-notes: 4.4.14 - May 9, 2022 ~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-64983` Release Client lock before rolling back WT transaction in TransactionParticipant::_resetTransactionState - :issue:`SERVER-62229` Fix invariant when applying index build entries while recoverFromOplogAsStandalone=true - :issue:`SERVER-60412` Host memory limit check does not honor cgroups v2 - :issue:`SERVER-55429` Abort migration earlier when receiver is not cleaning overlapping ranges - :issue:`WT-8924` Don't check against on disk time window if there is an insert list when checking for conflicts in row-store - `All JIRA issues closed in 4.4.14 `_ - :ref:`4.4.14-changelog` .. _4.4.13-release-notes: 4.4.13 - Mar 7, 2022 ~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-63203` Chunk splitter never splits if more than 8192 split points are found - :issue:`SERVER-62065` Upgrade path from 3.6 to 4.0 can leave chunk entries without history on the shards - :issue:`SERVER-59754` Incorrect logging of queryHash/planCacheKey for operations that share the same $lookup shape - :issue:`SERVER-55483` Add a new startup parameter that skips verifying the table log settings - :issue:`SERVER-40691` $nin:[...] queries are not indexed - `All JIRA issues closed in 4.4.13 `_ - :ref:`4.4.13-changelog` .. _4.4.12-release-notes: 4.4.12 - Jan 21, 2022 ~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-62203` Change the thread name "Health checks progress monitor" to "FaultManagerProgressMonitor" - :issue:`SERVER-61930` Individual health observers should return an error if a timeout period elapses when doing a single health check - :issue:`SERVER-61637` Review range deleter batching policy - :issue:`SERVER-59362` Setup Fault Manager State Machine - `All JIRA issues closed in 4.4.12 `_ - :ref:`4.4.12-changelog` .. _4.4.11-release-notes: 4.4.11 - Dec 30, 2021 ~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`WT-8395` Inconsistent data after upgrade from 4.4.3 and 4.4.4 to 4.4.8+ and 5.0.2+ - :issue:`SERVER-60326` Windows Server fails to start when X509 certificate has empty subject name - :issue:`SERVER-60310` OCSP response validation should not consider statuses of irrelevant certificates - :issue:`SERVER-59226` Deadlock when stepping down with a profile session marked as uninterruptible - :issue:`SERVER-56226` [v4.4] Introduce 'permitMigrations' field on config.collections entry to prevent chunk migrations from committing - :issue:`SERVER-51329` Unexpected non-retryable error when shutting down a mongos server - :issue:`SERVER-45953` Exempt oplog readers from acquiring read tickets - `All JIRA issues closed in 4.4.11 `_ - :ref:`4.4.11-changelog` .. _4.4.10-release-notes: 4.4.10 - Oct 15, 2021 ~~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-59876`: Large delays in returning from libcrypto.so while establishing egress connections - :issue:`SERVER-59867`: Split horizon mappings in ReplSetConfig/MemberConfig should be serialized deterministically - :issue:`SERVER-59456`: Start the LDAPReaper threadpool - :issue:`SERVER-59074`: Do not acquire storage tickets just to set/wait on oplog visibility - :issue:`SERVER-54064`: Sessions on arbiters accumulate and cannot be cleared out - `All JIRA issues closed in 4.4.10 `_ - :ref:`4.4.10-changelog` .. _4.4.9-release-notes: 4.4.9 - Sep 21, 2021 ~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-57630`: Enable SSL_OP_NO_RENEGOTIATION on Ubuntu 18.04 when running against OpenSSL 1.1.1 - :issue:`SERVER-34938`: Secondary slowdown or hang due to content pinned in cache by single oplog batch - :issue:`WT-8005`: Fix a prepare commit bug that could leave the history store entry unresolved - :issue:`WT-7995`: Fix the global visibility that it cannot go beyond checkpoint visibility - :issue:`WT-7984`: Fix a bug that could cause a checkpoint to omit a page of data - `All JIRA issues closed in 4.4.9 `_ - :ref:`4.4.9-changelog` .. _4.4.8-release-notes: 4.4.8 - Aug 4, 2021 ~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-58936`: Unique index constraints may not be enforced - :issue:`SERVER-58258`: Wait for initial sync to clear state before asserting 'replSetGetStatus' reply has no 'initialSync' field - :issue:`SERVER-52906`: moveChunk after failed migration that rolled back cloning indexes can hang indefinitely due to missing shard key index - :issue:`WT-7837`: Clear updates structure in wt_hs_insert_updates to avoid firing assert - :issue:`WT-6729`: Quiesce eviction prior running rollback to stable's active transaction check - `All JIRA issues closed in 4.4.8 `_ - :ref:`4.4.8-changelog` .. _4.4.7-release-notes: 4.4.7 - Jul 16, 2021 ~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-57476`: Operation may block on prepare conflict while holding oplog slot, stalling replication indefinitely - :issue:`SERVER-56054`: Change minThreads value for replication writer thread pool to 0 - :issue:`SERVER-53760`: $unwind + $sort pipeline produces large number of file handles when spilling to disk - :issue:`SERVER-47699`: Change yield type used by range deleter from YIELD_MANUAL to YIELD_AUTO - :issue:`WT-7185`: Avoid aborting a transaction if it is force evicting and oldest - `All JIRA issues closed in 4.4.7 `_ - :ref:`4.4.7-changelog` .. _4.4.6-release-notes: 4.4.6 - May 10, 2021 ~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-53604`: Include original aws iam arn in authenticate audit logs - :issue:`SERVER-52564`: Deadlock between step down and MongoDOperationContextSession - :issue:`WT-7442`: RTS to open dhandle only when the dhandle has unstable updates - :issue:`WT-7426`: Set write generation number when the page image gets created - :issue:`WT-7373`: Improve slow random cursor operations on oplog - `All JIRA issues closed in 4.4.6 `_ - :ref:`4.4.6-changelog` .. _4.4.5-release-notes: 4.4.5 - Apr 8, 2021 ~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-55298`: Reproduce and Investigate BSONObjectTooLarge error - :issue:`SERVER-53566`: Investigate and reproduce "opCtx != nullptr && _opCtx == nullptr" invariant - :issue:`SERVER-51281`: mongod live locked - :issue:`SERVER-46686`: Explain does not respect maxTimeMS - :issue:`SERVER-45836`: Provide more LDAP details (like server IP) at default log level - `All JIRA issues closed in 4.4.5 `_ - :ref:`4.4.5-changelog` .. _4.4.4-release-notes: 4.4.4 - Feb 16, 2021 ~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-48471`: Hashed indexes may be incorrectly marked multikey and be ineligible as a shard key - :issue:`SERVER-50769`: server restarted after expr{"expr":"_currentApplyOps.getArrayLength() > 0","file":"src/mongo/db/pipeline/document_source_change_stream_transform.cpp","line":535}} - :issue:`SERVER-52919`: Wire compression not enabled for initial sync - :issue:`WT-7109`: Retain no longer supported configuration options for backward compatibility - :issue:`WT-7117`: RTS to skip modifies that are more recent than on-disk base update while restoring an update - `All JIRA issues closed in 4.4.4 `_ - :ref:`4.4.4-changelog` .. _4.4.3-release-notes: 4.4.3 - Jan 4, 2021 ~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-33966`: redundant $sort in aggregation prevents best $limit $sort consolidation - :issue:`SERVER-40361`: Reduce memory footprint of plan cache entries - :issue:`SERVER-52654`: new signing keys not generated by the monitoring-keys-for-HMAC thread - :issue:`SERVER-52824`: Support AWS roles with paths - :issue:`SERVER-52929`: Correctly handle compound indexes with 32 keys - `All JIRA issues closed in 4.4.3 `_ - :ref:`4.4.3-changelog` .. _4.4.2-release-notes: 4.4.2 - Nov 18, 2020 ~~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-48067`: Reduce memory consumption for unique index builds with large numbers of non-unique keys - :issue:`SERVER-48523`: Unconditionally check the first entry in the oplog when attempting to resume a change stream - :issue:`SERVER-50365`: Stuck with long-running transactions that can't be timed out - :issue:`SERVER-50394`: mongod audit log attributes DDL operations to the __system user in a sharded environment - :issue:`SERVER-51041`: Throttle starting transactions for secondary reads - :issue:`SERVER-51120`: Find queries with MERGE_SORT incorrectly sort the results when the collation is specified - `All JIRA issues closed in 4.4.2 `_ - :ref:`4.4.2-changelog` .. _4.4.1-release-notes: 4.4.1 - Sep 9, 2020 ~~~~~~~~~~~~~~~~~~~ Issues fixed: - :issue:`SERVER-48531`: 3 way deadlock can happen between chunk splitter, prepared transactions and stepdown thread. - :issue:`SERVER-48641`: Deadlock due to the MigrationDestinationManager waiting for write concern with the session checked-out - :issue:`SERVER-49546`: setFCV to 4.4 should insert range deletion tasks in batches rather than one at a time - :issue:`SERVER-49694`: On a sharded cluster, nearest or hedged reads may not be routed to a near shard replica. - :issue:`SERVER-50137`: MongoDB crashes with Invariant failure due to oplog entries generated in 3.4 - :issue:`SERVER-50140`: Initial sync cannot survive unclean restart of the sync source - :issue:`SERVER-50170`: Fix server selection failure on mongos - :issue:`WT-6623`: Set the connection level file ID in recovery file scan - `All JIRA issues closed in 4.4.1 `_ - :ref:`4.4.1-changelog` .. _4.4-rel-notes-agg: Full Time Diagnostic Data Capture Requirements ---------------------------------------------- Starting in version 4.4, if the :ref:`Full Time Diagnostic Data Capture (FTDC) ` thread in :binary:`~bin.mongod` or :binary:`~bin.mongos` fails, it terminates the originating process. To avoid the most common failures, confirm that the user running ``mongod``/``mongos`` has permissions to create the FTDC ``diagnostic.data`` directory within :setting:`storage.dbPath` (for ``mongod``) or parallel to :setting:`systemLog.path` (for ``mongos``). Aggregation ----------- Union All (``$unionWith`` Stage) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MongoDB 4.4 adds the :pipeline:`$unionWith` aggregation stage, providing the ability to combines pipeline results from multiple collections into a single result set. For details, see :pipeline:`$unionWith`. Custom Aggregation Expressions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Starting in version 4.4, MongoDB provides the following new operators that allow users to define custom aggregation expressions: - :group:`$accumulator` - :expression:`$function` With the addition of these new operators, you can use aggregation to write custom JavaScript expressions instead of relying on :dbcommand:`mapReduce` and :query:`$where`. .. note:: Even before version 4.4, various map-reduce expressions could also be rewritten using :ref:`other aggregation pipeline operators `, such as :pipeline:`$group`, :pipeline:`$merge`, etc., without requiring custom functions. For more information, see :doc:`/reference/map-reduce-to-aggregation-pipeline`. .. _4.4-rel-notes-new-agg-operators: New Aggregation Operators ~~~~~~~~~~~~~~~~~~~~~~~~~ .. list-table:: :header-rows: 1 :widths: 20 80 * - Operator - Description * - :group:`$accumulator` - Returns the result of a user-defined :ref:`accumulator operator `. * - :expression:`$binarySize` - Returns the size of a given string or binary data value's content in bytes. * - :expression:`$bsonSize` - Returns the size in bytes of a given document (i.e. bsontype ``Object``) when encoded as :term:`BSON`. * - :expression:`$first` - Returns the first element in an array. * - :expression:`$function` - Defines a custom aggregation expression. * - :expression:`$isNumber` - Returns boolean ``true`` if the specified expression resolves to an :bsontype:`integer `, :bsontype:`decimal `, :bsontype:`double `, or :bsontype:`long `. Returns boolean ``false`` if the expression resolves to any other :doc:`BSON type `, ``null``, or a missing field * - :expression:`$last` - Returns the last element in an array. * - :expression:`$replaceOne` - Replaces the first instance of a matched string in a given input. * - :expression:`$replaceAll` - Replaces all instances of a matched string in a given input. General Aggregation Improvements ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``$out`` ```````` Starting in MongoDB 4.4: - :pipeline:`$out` can output to a collection in a different database. In earlier versions, :pipeline:`$out` can only output to a collection in the same database database where the aggregation is run. - :pipeline:`$out` can only run on replica set secondary nodes if all the nodes in cluster have :ref:`featureCompatibilityVersion ` set to ``4.4`` or higher and the :doc:`/core/read-preference` allows secondary reads. Check your :driver:`driver ` documentation to see when your driver added support. ``$indexStats`` ``````````````` Starting in MongoDB 4.4 (also available starting in 4.2.4), :pipeline:`$indexStats` includes the following fields in its output: .. list-table:: :header-rows: 1 :widths: 35 65 * - Field - Description * - :ref:`shard ` - Name of the shard, if applicable. * - :ref:`spec ` - Index specification document * - :ref:`building ` - A boolean flag that indicates if the index is currently being built. ``$merge`` `````````` Starting in MongoDB 4.4: - :pipeline:`$merge` can output to a collection in a different database. In earlier versions, :pipeline:`$merge` can only output to a collection in the same database where the aggregation is run. - :pipeline:`$merge` can only run on replica set secondary nodes if all the nodes in cluster have :ref:`featureCompatibilityVersion ` set to ``4.4`` or higher and the :doc:`/core/read-preference` allows secondary reads. Check your :driver:`driver ` documentation to see when your driver added support. .. include:: /includes/fact-merge-same-collection-behavior.rst .. include:: /includes/fact-merge-same-collection-warning.rst .. _4.4-agg-planCachesStats-changes: ``$planCacheStats`` Changes ``````````````````````````` .. include:: /includes/extracts/4.4-changes-planCache-changes.rst ``$collStats`` Changes `````````````````````` Starting in MongoDB 4.4, :pipeline:`$collStats` accepts the ``queryExecStats`` field as an argument document. Providing this field returns the following fields in the output: .. include:: /includes/fact-queryexecstats-reference.rst ``explain`` Changes ``````````````````` Starting in MongoDB 4.4, when you run the :method:`db.collection.explain().aggregate() ` method in ``executionStats`` and ``allPlansExecution`` modes, each :doc:`pipeline stage ` listed in the :doc:`explain output ` includes :data:`nReturned ` and :data:`executionTimeMillisEstimate `. Replica Sets ------------ Resumable Initial Sync ~~~~~~~~~~~~~~~~~~~~~~ Starting in MongoDB 4.4, a secondary performing initial sync can attempt to resume the sync process if interrupted by a *transient* (i.e. temporary) network error, collection drop, or collection rename. The sync source must also run MongoDB 4.4 to support resumable initial sync. If the sync source runs MongoDB 4.2 or earlier, the secondary must restart the initial sync process as if it encountered a non-transient network error. By default, the secondary tries to resume initial sync for 24 hours. MongoDB 4.4 adds the :parameter:`initialSyncTransientErrorRetryPeriodSeconds` server parameter for controlling the amount of time the secondary attempts to resume initial sync. If the secondary cannot successfully resume the initial sync process during the configured time period, it selects a new healthy source from the replica set and restarts the initial synchronization process from the beginning. Prior to MongoDB 4.4, the secondary would restart the entire initial sync if it encountered an error during the process. Streaming Replication ~~~~~~~~~~~~~~~~~~~~~ Starting in MongoDB 4.4, *sync from* sources send a continuous stream of :doc:`oplog ` entries to their syncing secondaries. Prior to MongoDB 4.4, secondaries fetched batches of :doc:`oplog ` entries by issuing a request to their *sync from* source and waiting for a response. This required a network roundtrip for each batch of :doc:`oplog ` entries. MongoDB 4.4 adds the :parameter:`oplogFetcherUsesExhaust` startup parameter for disabling streaming replication and using the older replication behavior. For details, see :ref:`replica-set-streaming-replication`. Rollback Directory ~~~~~~~~~~~~~~~~~~ .. include:: /includes/extracts/4.4-changes-rollback-directory.rst Minimum Oplog Retention Period ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. include:: /includes/extracts/4.4-changes-minimum-oplog-retention-period.rst To configure the minimum oplog retention period when starting the :binary:`~bin.mongod`, either: - Add the :setting:`storage.oplogMinRetentionHours` setting to the :binary:`~bin.mongod` :ref:`configuration file `. *-or-* - Add the :option:`--oplogMinRetentionHours ` command line option. To configure the minimum oplog retention period on a running :binary:`~bin.mongod`, use :dbcommand:`replSetResizeOplog`. Setting the minimum oplog retention period while the :binary:`~bin.mongod` is running overrides any values set on startup. You must update the value of the corresponding configuration file setting or command line option to persist those changes through a server restart. .. important:: The oplog can grow without constraint so as to retain oplog entries for the configured number of hours. This may result in reduction or exhaustion of system disk space due to a combination of high write volume and large retention period. .. seealso:: :doc:`/core/replica-set-oplog` ``slowOpSampleRate`` Affects Secondary Logs ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Starting in MongoDB 4.4, :ref:`slow oplog application ` logs on replica set secondaries are affected by the :setting:`~operationProfiling.slowOpSampleRate`. In previous versions, MongoDB logs all slow oplog entries regardless of the sample rate. :setting:`~operationProfiling.slowOpSampleRate` specifies the fraction of slow operations that should be profiled or logged. Indexes Build Simultaneously on Data-Bearing Replica Set Members ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. include:: /includes/extracts/4.4-changes-index-builds-simultaneous-fcv.rst .. include:: /includes/extracts/4.4-changes-index-builds-simultaneous-nolink.rst By default, index builds use a commit quorum of all data-bearing voting members. To start an index build with a non-default commit quorum, MongoDB 4.4 adds the :ref:`commitQuorum ` parameter to :dbcommand:`createIndexes` or its shell helpers :method:`db.collection.createIndex()` and :method:`db.collection.createIndexes()`. To modify the quorum required for an in-progress index build, MongoDB 4.4 introduces the new :dbcommand:`setIndexCommitQuorum` command. See :ref:`index-operations-replicated-build` for more information. Replica Set Reconfiguration Changes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Changes to ``replSetReconfig`` `````````````````````````````` .. include:: /includes/extracts/4.4-replSetReconfig-majority.rst .. include:: /includes/extracts/4.4-replSetReconfig-single-node-voting-change.rst Changes to ``replSetGetConfig`` ``````````````````````````````` .. include:: /includes/extracts/4.4-replSetGetConfiguration-commitmentStatus.rst .. |moreinfo| replace:: For more information, see the :ref:`replSetGetConfig ` command. Changes to Replica Configuration Document ````````````````````````````````````````` .. include:: /includes/extracts/4.4-replSetGetConfig-term-field.rst Preferred Initial Sync Source ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Starting in MongoDB 4.4, you can specify the preferred initial sync source using the :parameter:`initialSyncSourceReadPreference` parameter. You can only set this parameter on :binary:`~bin.mongod` startup, using either the :setting:`setParameter` configuration file setting or the :option:`--setParameter ` command line option. :parameter:`initialSyncSourceReadPreference` supports following read preference modes: - :readmode:`primary` - :readmode:`primaryPreferred` (Default for voting replica set members) - :readmode:`secondary` - :readmode:`secondaryPreferred` - :readmode:`nearest` (Default for newly added *or* non-voting replica set members) If the replica set has disabled :rsconf:`chaining `, the default :parameter:`initialSyncSourceReadPreference` read preference mode is :readmode:`primary`. You cannot specify a tag set or ``maxStalenessSeconds`` to :parameter:`initialSyncSourceReadPreference`. .. seealso:: :ref:`replica-set-initial-sync-source-selection` .. _4.4-mirrored-reads: Mirrored Reads ~~~~~~~~~~~~~~ Starting in version 4.4, MongoDB provides :ref:`mirrored reads ` to pre-warm electable secondary members' cache with the most recently accessed data. With mirrored reads, the primary can mirror a subset of :ref:`operations ` that it receives and send them to a subset of electable secondaries. Pre-warming the cache of a secondary can help restore performance more quickly after an election. .. note:: The primary's response to the client is not affected by the mirror reads. The mirrored reads are "fire-and-forget" operations by the primary; i.e., the primary does not await the response for the mirrored reads. Mirrored Reads Parameter ```````````````````````` MongoDB 4.4 adds the following mirrored reads parameter. You can set the parameter at startup using the :setting:`setParameter` configuration file setting or the :option:`--setParameter ` command line option or at runtime with :dbcommand:`setParameter` command: .. list-table:: :widths: 20 80 :header-rows: 1 * - Parameter - Description * - :parameter:`mirrorReads` - Specifies the ``samplingRate`` and ``maxTimeMS`` settings for mirrored reads. ``{ samplingRate: , maxTimeMS: }`` A ``samplingRate`` of ``0`` turns off mirrored reads. Mirrored Reads Metrics `````````````````````` The command :dbcommand:`serverStatus` and its corresponding :binary:`~bin.mongo` shell method :method:`db.serverStatus()` return :serverstatus:`mirroredReads` if you specify the field's inclusion in the operation: .. code-block:: javascript db.runCommand( { serverStatus: 1, mirroredReads: 1 } ) or .. code-block:: javascript db.serverStatus( { mirroredReads: 1 } ) Sharded Clusters ---------------- Refinable Shard Keys ~~~~~~~~~~~~~~~~~~~~ Starting in 4.4, MongoDB provides the :dbcommand:`refineCollectionShardKey` command. With the new command, you can refine a collection's shard key by adding a suffix field or fields to the existing key. Refining a collection's shard key allows for a more fine-grained data distribution and can address situations where the existing key has led to :ref:`jumbo (i.e. indivisible) chunks ` due to insufficient cardinality. For example, you may have an existing ``orders`` collection with the shard key ``{ customer_id: 1 }``. You can change the shard key by adding a suffix ``order_id`` field to the shard key so that ``{ customer_id: 1, order_id: 1 }`` becomes the new shard key, allowing data distribution by both ``customer_id`` and ``order_id`` fields. To use the :dbcommand:`refineCollectionShardKey` command, the sharded cluster must have :ref:`feature compatibility version (fcv) ` of ``4.4``. For more information, see the :dbcommand:`refineCollectionShardKey` command. .. note:: After you refine the shard key, it may be that not all documents in the collection have the suffix field(s). To populate the missing shard key field(s), see :ref:`shard-key-missing`. Before refining the shard key, ensure that all or most documents in the collection have the suffix fields, if possible, to avoid having to populate the field afterwards. In earlier versions, once you select a shard key, you cannot modify the shard key. .. important:: Missing Shard Keys With the ability to refine a shard key with a suffix, it may be that not all documents in the collection have the suffix fields. Starting in version 4.4, documents in a sharded collection can be missing the shard key fields. In earlier versions, shard key fields must exist in every document for a sharded collection. For details, see :ref:`shard-key-missing`. Hedged Reads ~~~~~~~~~~~~ To minimize latencies, :binary:`~bin.mongos` instances, by default, can use :ref:`hedge reads `. With hedged reads, the :binary:`~bin.mongos` instances can route read operations to multiple members per each queried shard and return results from the first respondent per shard. By default, :binary:`~bin.mongos` instances support using hedged reads. To turn off a :binary:`~bin.mongos` instance's support for hedged reads, set the :parameter:`readHedgingMode` parameter for the :binary:`~bin.mongos`. Hedged reads are specified per operation as part of the read preference. Non-``primary`` :doc:`read preferences ` support hedged reads. Read preference :readmode:`nearest` specifies hedged read by default. For more information, see: - :ref:`mongos-hedged-reads` - :ref:`replica-set-read-preference-behavior-mongos` Hedged Read Parameters `````````````````````` .. list-table:: :widths: 40 60 :header-rows: 1 * - Parameter - Description * - :parameter:`readHedgingMode` - Enables or disables :binary:`~bin.mongos` instance's support for hedged reads. * - :parameter:`maxTimeMSForHedgedReads` - Specifies the maximimum time limit (in milliseconds) for the additional read sent to :ref:`hedge a read operation `. Hedged Read Option for Read Preference `````````````````````````````````````` To specify hedged read for a read preference, MongoDB 4.4 introduces the :ref:`read-preference-hedged-read`. To set using a MongoDB driver, refer to the driver :driver:`read preference API documentation`. The following :binary:`~bin.mongo` shell methods can accept hedge options to enable hedged read for the specified read preference: - :method:`cursor.readPref()` - :method:`Mongo.setReadPref()` Hedged Read Metrics ``````````````````` The command :dbcommand:`serverStatus` and its corresponding :binary:`~bin.mongo` shell method :method:`db.serverStatus()` return :serverstatus:`hedgingMetrics`. ``balancerCollectionStatus`` Command ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MongoDB 4.4 provides the command :dbcommand:`balancerCollectionStatus` and the :binary:`~bin.mongo` shell helper method :method:`sh.balancerCollectionStatus()` that return information about whether the chunks of a sharded collection are balanced (i.e. do not need to be moved) as of the time the command is run or need to be moved. With the command, users can verify that initial chunk creation and migration has finished. Improved ``mongos`` Startup Procedure ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Starting with MongoDB 4.4, :binary:`~bin.mongos` adds the following new default startup behavior: - :binary:`~bin.mongos` preloads a sharded cluster's routing table on startup, rather than doing so on-demand for the first incoming client connection. - :binary:`~bin.mongos` prewarms its connection pool to shard hosts on startup, rather than doing so on-demand for incoming client connections. This behavior results in faster servicing of initial client connections after a :binary:`~bin.mongos` instance is started or restarted. In particular, this allows sites that employ multiple :binary:`~bin.mongos` instances to restart them as necessary, or add new ones, without initial client requests to those instances needing to wait on connection establishment. Both routing table preloading and connection pool prewarming are enabled by default. MongoDB 4.4 adds the following parameters for controlling this behavior: - :parameter:`loadRoutingTableOnStartup` - *Default*: ``true`` (Enabled) - Enables or disables support for preloading the routing table on startup for the :binary:`~bin.mongos`. - :parameter:`warmMinConnectionsInShardingTaskExecutorPoolOnStartup` - *Default*: ``true`` (Enabled) - Enables or disables support for prewarming the connection pool on startup for the :binary:`~bin.mongos`. - :parameter:`warmMinConnectionsInShardingTaskExecutorPoolOnStartupWaitMS` - *Default*: ``2000`` (2 seconds) - Sets the timeout in milliseconds before client connections to the :binary:`~bin.mongos` are allowed regardless of established connection pool size. Improved Routing Table Updates ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Running :dbcommand:`flushRouterConfig` is no longer required after executing the :dbcommand:`movePrimary` or :dbcommand:`dropDatabase` commands. These two commands now automatically refresh a sharded cluster's routing table as needed when run. Manually issuing the :dbcommand:`flushRouterConfig` command is still recommended in the cases described under :ref:`flushRouterConfig Considerations`. .. _4.4-rel-notes-sharding-compound-hashed: Compound Hashed Shard Keys ~~~~~~~~~~~~~~~~~~~~~~~~~~ Starting in MongoDB 4.4, you can shard a collection using a compound shard key with a single hashed field. Prior to 4.4, MongoDB did not support compound shard keys with a hashed field. Compound hashed sharding supports features like :ref:`zone sharding `, where the prefix (i.e. first) non-hashed field or fields support zone ranges while the hashed field supports more even distribution of the sharded data. For example, the following operation shards a collection on a compound hashed shard key that supports zoned sharding: .. code-block:: javascript sh.shardCollection( "examples.compoundHashedCollection", { "fieldA" : 1, "fieldB" : 1, "fieldC" : "hashed" } ) Compound hashed sharding also supports shard keys with a hashed prefix for resolving data distribution issues related to :ref:`monotonically increasing fields ` For example, the following operation shards a collection on a compound hashed shard key where the hashed field is the shard key prefix: .. code-block:: javascript sh.shardCollection( "examples.compoundHashedCollection", { "_id" : "hashed", "fieldA" : 1} ) .. seealso:: - :ref:`sharding-hashed-sharding` - :ref:`4.4-rel-notes-compound-hashed-index` Chunk Migration Failover Resiliency Improvements ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Starting in MongoDB 4.4, the following changes improve :term:`chunk` migrations and :term:`orphaned document` cleanup resiliency during failover: - Chunk ranges awaiting cleanup after a chunk migration are now persisted in the :data:`config.rangeDeletions` collection and replicated throughout the shard. In the event of a failover, the shard's new primary reads the documents in the :data:`config.rangeDeletions` collection and resumes deleting the corresponding ranges. The document that describes a range awaiting cleanup is deleted from the :data:`config.rangeDeletions` collection after the range is deleted. - The :dbcommand:`cleanupOrphaned` command no longer deletes orphaned documents from a shard. Instead, :dbcommand:`cleanupOrphaned` waits for orphaned documents that are scheduled for deletion from a shard to be deleted. Set the :parameter:`disableResumableRangeDeleter` parameter to ``true`` on a shard's primary to pause range deletion on the shard. General Sharded Clusters Improvements ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Index Consistency Checks ```````````````````````` Starting in MongoDB 4.4, the :doc:`config server ` primary, by default, checks for index inconsistencies across the shards for sharded collections. The command :dbcommand:`serverStatus` returns the field :serverstatus:`shardedIndexConsistency` to report on index inconsistencies when run on the config server primary. To configure the index consistency checks, MongoDB provides the following parameters: .. list-table:: :header-rows: 1 :widths: 40 65 * - Parameter - Description * - :parameter:`enableShardedIndexConsistencyCheck` - Enable or disable the index consistency checks. * - :parameter:`shardedIndexConsistencyCheckIntervalMS` - The interval at which the config server's primary checks the index consistency of sharded collections. Concurrent ``removeShard`` Operations ````````````````````````````````````` Starting in MongoDB 4.4, you can have more than one :dbcommand:`removeShard` operation in progress. In earlier versions, :dbcommand:`removeShard` returns an error if another :dbcommand:`removeShard` operation is in progress. Shard Key Limit ``````````````` Starting in version 4.4, MongoDB removes the 512-byte limit on the shard key size. For MongoDB 4.2 and earlier, a shard key cannot exceed 512 bytes. Partial Results ``````````````` Starting in 4.4, if the :dbcommand:`find` or subsequent :dbcommand:`getMore` commands return partial results due to the unavailability of the queried shard(s), the output includes a boolean flag ``partialResultsReturned``. Jumbo Chunk Migration ````````````````````` .. include:: /includes/extracts/4.4-changes-migrate-jumbo-chunks.rst Improved Catalog Cache Refresh `````````````````````````````` Starting in 4.4, if there is a stale chunk, the catalog cache is only refreshed when :ref:`routers ` access a shard that previously had or currently has that chunk. Prior to MongoDB 4.4, any stale chunk caused the entire chunk distribution for a collection to be marked as stale and forced all :ref:`routers ` who contact the shard to refresh their shard catalog cache. MongoDB 4.4 adds the :parameter:`enableFinerGrainedCatalogCacheRefresh` startup parameter for disabling catalog cache refresh for only a targeted shard and using the older catalog cache refresh behavior. The :parameter:`enableFinerGrainedCatalogCacheRefresh` parameter defaults to ``true``. Automatically Split ``system.sessions`` Collection `````````````````````````````````````````````````` Starting in version 4.4 (and 4.2.7), MongoDB automatically splits the ``system.sessions`` collection into at least 1024 chunks and distributes the chunks uniformly across shards in the cluster. .. _4.4-projection: Projection ---------- Starting in MongoDB 4.4, as part of making :method:`~db.collection.find` and :method:`~db.collection.findAndModify` projection consistent with aggregation's :pipeline:`$project` stage, - The :method:`~db.collection.find` and :method:`~db.collection.findAndModify` projection can accept aggregation expressions and aggregation syntax, including the use of literals and aggregation variables. With the use of aggregation expressions and syntax, you can project new fields or project existing fields with new values. - The :method:`~db.collection.find` and :method:`~db.collection.findAndModify` projection can specify embedded fields using the nested form; e.g. ``{ field: { nestedfield: 1 } }`` as well as :ref:`dot notation `. In earlier versions, you can only use the dot notation. For more information, see: - :method:`db.collection.find()` - :method:`db.collection.findOneAndDelete()` - :method:`db.collection.findOneAndReplace()` - :method:`db.collection.findOneAndUpdate()` - :method:`db.collection.findAndModify()` .. seealso:: :ref:`4.4-compatibility-projection-restrictions` .. _4.4-rel-notes-projection-meta-keyword: .. _4.4-rel-notes-agg-meta-keyword: ``$meta`` Operator ~~~~~~~~~~~~~~~~~~ ``$meta`` Keyword Support ````````````````````````` Starting in MongoDB 4.4, the :expression:`$meta` operator adds support for retrieving the ``indexKey`` metadata. The ``indexKey`` metadata is for debugging purposes only and not for application logic. See :expression:`$meta` for more information. ``{ $meta: "textScore" }`` Usage with ``find()`` ```````````````````````````````````````````````` Starting in version 4.4, MongoDB makes the following :expression:`{ $meta: "textScore" } <$meta>` changes when used with :method:`db.collection.find()`: - You must specify the :query:`$text` operator in the query predicate to use :expression:`{ $meta: "textScore" } <$meta>`. - You can sort the resulting documents by their search relevance, i.e. :expression:`{ $meta: "textScore" } <$meta>`, without also having to project the ``textScore``. | In earlier versions, to include :expression:`{ $meta: "textScore" } <$meta>` expression in the :method:`~cursor.sort()`, you must also include the same expression in the projection. | - If you include the :expression:`{ $meta: "textScore" } <$meta>` expression in both the projection and sort, i.e. ``db.collection.find(<$text search>, ).sort()``, the projection and sort documents can have different field names for the expression. | In previous versions of MongoDB, if you include the :expression:`{ $meta: "textScore" } <$meta>` in both the projection and sort, you must specify the same field name in both places. For more information, see :ref:`project-meta-textscore-sort`. For examples of ``"textScore"`` projections and sorts, see :ref:`ex-text-search-score`. See: :ref:`4.4-compatibility-meta-textscore` Transactions ------------ Starting in MongoDB 4.4 with :ref:`feature compatibility version (fcv) ` ``"4.4"``, you can create collections and indexes inside a :doc:`multi-document transaction ` unless the transaction is a cross-shard write transaction. When creating a collection inside a transaction: - You can :ref:`implicitly create a collection `, such as with: - an insert operation against a non-existing collection; - an update/findAndModify operation with ``upsert: true`` against a non-existing collection. - You can explicitly create a collection using the :dbcommand:`create` command or its helper :method:`db.createCollection()`. - The :method:`db.createCollection()` method fails if executed against a :doc:`system collection `. When :ref:`creating an index ` inside a transaction: - You can create an index on a non-existing collection. The collection is created as part of the operation. - You can create an index on a new empty collection created earlier in the same transaction. - The :method:`db.collection.createIndex()` method fails if executed against a :doc:`system collection `. For more details, see :ref:`transactions-create-collections-indexes`. MongoDB 4.4 adds a new parameter :parameter:`shouldMultiDocTxnCreateCollectionAndIndexes` which can enable (default) or disable collection and index creation inside a transaction. When setting the parameter for a sharded cluster, set the parameter on all shards. For explicit creation of a collection or an index inside a transaction, the transaction read concern level must be :readconcern:`"local"`. Explicit creation is through: .. list-table:: :header-rows: 1 * - Command - Method * - :dbcommand:`create` - :method:`db.createCollection()` * - :dbcommand:`createIndexes` - | :method:`db.collection.createIndex()` | :method:`db.collection.createIndexes()` .. seealso:: - :doc:`/core/transactions` - :ref:`transactions-operations-ref` Sorting ------- ``$sort`` Changes ~~~~~~~~~~~~~~~~~ Starting in MongoDB 4.4, the :method:`~cursor.sort()` method now uses the same sort algorithm as the :pipeline:`$sort` aggregation stage. With this change, queries which perform a :method:`~cursor.sort()` on fields that contain duplicate values are much more likely to result in inconsistent sort orders for those values. To guarantee sort consistency when using :method:`~cursor.sort()` on duplicate values, include an additional field in your sort that contains exclusively unique values. This can be accomplished easily by adding the ``_id`` field to your sort. See :ref:`sort-cursor-consistent-sorting` for more information. Security Improvements --------------------- New Kerberos Validation Tool ``mongokerberos`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MongoDB Enterprise 4.4 provides a new :binary:`~bin.mongokerberos` tool for validating your platform's Kerberos configuration for use with MongoDB, and for testing end-to-end client authentication through Kerberos. When run, :binary:`~bin.mongokerberos` returns a report indicating any issues encountered, and provides potential advice for resolving them. :binary:`~bin.mongokerberos` is available in MongoDB Enterprise only. OCSP ~~~~ Starting in version 4.4, MongoDB enables, by default, the use of OCSP (Online Certificate Status Protocol) to check for certificate revocation. The use of OCSP eliminates the need to periodically download a :setting:`Certificate Revocation List (CRL) ` and restart the :binary:`mongod` / :binary:`mongos` with the updated CRL. In versions 4.0 and 4.2, the use of OCSP is available only through the use of :setting:`system certificate store ` on Windows or macOS. .. seealso:: :doc:`/core/security-transport-encryption` OCSP Stapling/Must Staple ````````````````````````` As part of its OCSP support, MongoDB 4.4 supports the following on Linux: .. include:: /includes/list-ocsp-support.rst OCSP Parameters ``````````````` MongoDB 4.4 adds the following OCSP parameters. You can set these parameters at startup using the :setting:`setParameter` configuration file setting or the :option:`--setParameter ` command line option: .. include:: /includes/list-table-ocsp-parameters.rst .. _4.4-rel-notes-certificate-expiration-warning: x.509 Certificates Nearing Expiry Trigger Warnings ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Starting in MongoDB 4.4, :binary:`mongod` / :binary:`mongos` logs a warning on connection if the presented x.509 certificate expires within ``30`` days of the ``mongod/mongos`` system clock. Specifically, the following connections to a ``mongod`` or ``mongos`` can trigger x.509 certificate expiry warnings: - A :binary:`~bin.mongo` shell or an application using a :driver:`MongoDB driver ` establishing a :ref:`TLS connection ` *or* performing :ref:`x.509 client authentication ` with a certificate expiring in less than 30 days. (i.e. the certificate specified to :option:`mongo --tlsCertificateKeyFile ` or :urioption:`tlsCertificateKeyFile`). - A :binary:`~bin.mongod` cluster member performing :ref:`x.509 membership authentication ` with a certificate expiring in less than 30 days. (i.e. the certificate specified to :setting:`net.tls.clusterFile`, :setting:`net.tls.clusterCertificateSelector`, :option:`mongod --tlsClusterFile ` or :option:`mongod --tlsClusterCertificateSelector `). - A :binary:`~bin.mongos` cluster member performing :ref:`x.509 membership authentication ` with a certificate expiring within 30 days. (i.e. the certificate specified to (i.e. the certificate specified to :setting:`net.tls.clusterFile`, :setting:`net.tls.clusterCertificateSelector`, :option:`mongos --tlsClusterFile ` or :option:`mongos --tlsClusterCertificateSelector`). The warning log message resembles the following: .. code-block:: text :copyable: false W NETWORK [connection] Peer certificate expires... Consider proactively renewing client x.509 certificates nearing expiration to ensure continued connectivity to the cluster. MongoDB 4.4 adds the :parameter:`tlsX509ExpirationWarningThresholdDays` parameter for controlling certificate expiration warning threshold. Set the parameter to ``0`` to disable the warning. For complete documentation, see :parameter:`tlsX509ExpirationWarningThresholdDays`. TLS 1.3 Support ~~~~~~~~~~~~~~~ On CentOS 8 and RHEL 8, MongoDB 4.4 (as well as versions 4.2, 4.0, and 3.6) support TLS1.3. User to DN Mapping Exits on Network or Authentication Failures ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A :binary:`~bin.mongod`, :binary:`~bin.mongos`, or :binary:`~bin.mongoldap` returns an error if one of the user to Distinguished Name (DN) mappings cannot be evaluated due to networking or authentication failures to the LDAP server. The :binary:`~bin.mongod`, :binary:`~bin.mongos`, or :binary:`~bin.mongoldap` rejects the connection request and does not check the remaining mappings, if any. To specify the user to DN mapping, see: - :setting:`security.ldap.userToDNMapping` - :option:`mongod --ldapUserToDNMapping` - :option:`mongos --ldapUserToDNMapping` - :option:`mongoldap --ldapUserToDNMapping` Structured Logging ------------------ Starting in MongoDB 4.4, :binary:`~bin.mongod` / :binary:`~bin.mongos` instances now output all log messages in :ref:`structured JSON format `. Log entries are written as a series of key-value pairs, where each key indicates a log message field type, such as "severity", and each corresponding value records the associated logging information for that field type, such as "informational". This includes log output sent to the *file*, *syslog*, and *stdout* (standard out) :ref:`log destinations `, as well as the output of the :dbcommand:`getLog` command. Previously, log entries were output as plaintext. The following log messages in JSON format indicate that a :binary:`~bin.mongod` is listening and ready for connections: .. code-block:: javascript :copyable: false {"t":{"$date":"2020-05-18T20:18:13.533+00:00"},"s":"I", "c":"NETWORK", "id":23015, "ctx":"listener","msg":"Listening on","attr":{"address":"127.0.0.1"}} {"t":{"$date":"2020-05-18T20:18:13.533+00:00"},"s":"I", "c":"NETWORK", "id":23016, "ctx":"listener","msg":"Waiting for connections","attr":{"port":27001,"ssl":"off"}} Structured logging with key-value pairs allows for efficient log analysis by automated tools or log ingestion services, and makes programmatic :ref:`log parsing ` easier and more powerful. .. include:: /includes/fact-use-jq-with-structured-logging.rst For more information on structured logging, including a detailed examination of log entry components as well as command-line parsing examples, see :doc:`Log Messages `. Multiple LDAP Password Support ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Starting in MongoDB 4.4, the ``ldapQueryPassword`` :dbcommand:`setParameter` command accepts either a string or an array of strings. If set to an array, each password is tried until one succeeds. This can be used to perform a rollover of the LDAP account password without downtime for MongoDB. Platform Support ---------------- Added Platforms ~~~~~~~~~~~~~~~ MongoDB 4.4 adds support for the following platforms: - **RHEL 8 / CentOS 8 / Oracle 8** on the :ref:`PPC64LE ` and :ref:`s390x ` architectures - **SLES 15** on the :ref:`s390x ` architecture - **Ubuntu 20.04** on the :ref:`x86_64 `, :ref:`PPC64LE `, :ref:`ARM64 `, and :ref:`s390x ` architectures Removed Platforms ~~~~~~~~~~~~~~~~~ MongoDB 4.4 removes support for the following platforms: - **Amazon Linux 2013.03** - **RHEL 6 / CentOS 6 / Oracle 6** on the :ref:`s390x ` architecture - **Windows 7 / Server 2008 R2** - **Windows 8 / Server 2012** - **Windows 8.1 / Server 2012 R2** - **macOS 10.12** - **Ubuntu 18.04 PPC64LE** - Starting in MongoDB 4.4.11, Community Edition - **RHEL-72-s390x** - Starting in MongoDB 4.4.11, Enterprise Edition - **Ubuntu 18.04 PPC64LE** See :ref:`prod-notes-supported-platforms` for the full list of platforms and architectures supported in MongoDB 4.4. Mongo Shell ----------- Mongo Shell Supports AWS IAM Credentials for Atlas Clusters ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Starting in MongoDB 4.4, the :binary:`~bin.mongo` shell supports using `AWS IAM credentials `__ to authenticate to a `MongoDB Atlas `__ cluster that has been configured for AWS IAM authentication. Authenticating in this manner uses the new ``MONGODB-AWS`` :urioption:`authentication mechanism `, and requires that you provide an AWS access key ID and a secret access key, which may be specified in the :ref:`connection string ` or on the command-line via the :option:`--username ` and :option:`--password ` options. Additionally, if you are using an `AWS session token `__ for authentication with temporary credentials when using an `AssumeRole `__ request, or when working with AWS resources that specify this value such as Lambda, you may provide that session token in the connection string using the ``AWS_SESSION_TOKEN`` :urioption:`authMechanismProperties` value, or on the command-line via the :option:`--awsIamSessionToken ` option. Alternatively, if the AWS access key ID, secret access key, or session token are defined on your platform using their respective `AWS IAM environment variables `__ the ``mongo`` shell uses these environment variable values to authenticate; you do not need to specify them in the connection string. See :ref:`Connection String Authentication Options ` for usage, and :ref:`Connecting to an Atlas Cluster using MONGODB-AWS ` for examples. Tools ----- Migration to MongoDB Database Tools Project ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Starting in MongoDB 4.4, the documentation for the following tools have been migrated to the `MongoDB Database Tools project `__: - :binary:`~bin.mongoimport` - :binary:`~bin.mongoexport` - :binary:`~bin.mongodump` - :binary:`~bin.mongorestore` - :binary:`~bin.mongotop` - :binary:`~bin.mongostat` - :binary:`~bin.mongofiles` - :binary:`~bin.bsondump` The MongoDB Database Tools use the Apache License, Version 2.0. See `mongodb/mongo-tools `__ for the source code. .. note:: For documentation on previous versions of the listed tools, reference that version of the MongoDB server manual. *Quick links to older documentation:* - :v4.2:`MongoDB 4.2 Tools ` - :v4.0:`MongoDB 4.0 Tools ` - :v3.6:`MongoDB 3.6 Tools ` New ``mongokerberos`` Kerberos Validation Tool ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MongoDB Enterprise 4.4 provides a new :binary:`~bin.mongokerberos` tool for validating your platform's Kerberos configuration for use with MongoDB, and for testing end-to-end client authentication through Kerberos. When run, :binary:`~bin.mongokerberos` returns a report indicating any issues encountered, and provides potential advice for resolving them. :binary:`~bin.mongokerberos` is available in MongoDB Enterprise only. See the :binary:`~bin.mongokerberos` reference page for more information. ``mongoreplay`` Removed from MongoDB Packaging ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Starting in MongoDB 4.4, ``mongoreplay`` is removed from MongoDB packaging. ``mongoreplay`` and its related documentation are migrated to the `mongodb-labs `__ github project. Projects in ``mongodb-labs`` are experimental and not officially supported by MongoDB. *Quick links to older documentation* - :v4.2:`mongoreplay 4.2 ` - :v4.0:`mongoreplay 4.0 ` - :v3.6:`mongoreplay 3.6 ` MongoDB Database Tools Not Packaged with Windows MSI ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. include:: /includes/extracts/4.4-changes-tools.rst Drivers ------- New Drivers ~~~~~~~~~~~ - The official `MongoDB Rust driver `__ is now available. - The official `MongoDB Swift driver `__ is now available. .. _4.4-removed-commands: Indexes ------- .. _4.4-rel-notes-compound-hashed-index: Compound Hashed Indexes ~~~~~~~~~~~~~~~~~~~~~~~ MongoDB 4.4 adds support for creating compound indexes with a single :ref:`hashed field `. MongoDB 4.2 and earlier only supported single field hashed indexes. The following operation creates a compound hashed index on ``country`` and ``_id``: .. code-block:: javascript db.examples.createIndex( { "country" : 1, "_id" : "hashed" } ) Compound hashed indexes require :ref:`featureCompatibilityVersion ` set to ``4.4``. .. seealso:: :ref:`4.4-rel-notes-sharding-compound-hashed` Hidden Indexes ~~~~~~~~~~~~~~ Starting in version 4.4, MongoDB adds the ability to hide or unhide indexes from the query planner. An index hidden from the query planner is not evaluated as part of query plan selection. By hiding an index from the planner, users can evaluate the potential impact of dropping an index without having to drop the index. If the impact is negative, the user can unhide the index instead of having to recreate a dropped index. And because indexes are fully maintained while hidden, hidden indexes are immediately available for use once unhidden. For details, see :doc:`/core/index-hidden`. To support :doc:`hidden indexes `, MongoDB introduces: - A new index option ``hidden``. The option can be specified in the following operations: - :ref:`createIndexes ` command - :ref:`db.collection.createIndex() ` and :ref:`db.collection.createIndexes() ` methods - :collflag:`collMod ` command - New :binary:`~bin.mongo` shell helper methods to hide or unhide existing indexes: - :method:`db.collection.hideIndex()` - :method:`db.collection.unhideIndex()` ``dropIndexes`` Can Abort In-Progress Index Builds ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If an index specified to :dbcommand:`dropIndexes` is still building, :dbcommand:`dropIndexes` attempts to abort the in-progress build. Aborting an index build has the same effect as dropping the built index. Prior to MongoDB 4.4, :dbcommand:`dropIndexes` would return an error if the collection had any in-progress index builds. This behavior also applies to the shell helpers :method:`db.collection.dropIndex()` and :method:`db.collection.dropIndexes()`. - The indexes specified to :dbcommand:`dropIndexes` / :method:`~db.collection.dropIndexes()` must be the entire set of in-progress builds associated to a given index builder, i.e. the indexes built by a single :dbcommand:`createIndexes` or :method:`db.collection.createIndexes()` operation. - The index specified to :method:`~db.collection.dropIndex()` must be the only index associated to the index builder, i.e. the indexes built by a single :dbcommand:`createIndexes` or :method:`db.collection.createIndexes()` operation. To drop a specific index out of a set of related in-progress builds, wait until the index builds complete and specify that index to :dbcommand:`dropIndexes` or its shell helpers. For more complete documentation, see: - :ref:`dropIndexes-cmd-index-builds` for the :dbcommand:`dropIndexes` command. - :ref:`dropIndexes-method-index-builds` for the :method:`~db.collection.dropIndexes()` method. - :ref:`dropIndex-method-index-builds` for the :method:`~db.collection.dropIndex()` method. ``drop()`` Can Abort In-Progress Index Builds ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. include:: /includes/extracts/4.4-changes-drop-in-progress-indexes.rst .. include:: /includes/fact-abort-index-build-replica-sets.rst ``dropDatabase`` Can Abort In-Progress Index Builds ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. include:: /includes/extracts/4.4-changes-drop-database-in-progress-indexes.rst .. seealso:: :ref:`index-operations` Deprecation of ``geoHaystack`` Index and ``geoSearch`` Command ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. include:: /includes/extracts/4.4-changes-geo-deprecation.rst Removed Commands ---------------- .. include:: /includes/extracts/4.4-changes-removed-commands.rst .. _4.4-rel-notes-networking: Networking ---------- .. _4.4-rel-notes-tcp-fast-open: Support for TCP Fast Open ~~~~~~~~~~~~~~~~~~~~~~~~~ Starting with MongoDB 4.4, :binary:`~bin.mongod` and :binary:`~bin.mongos` support TCP Fast Open (TFO) connections by default. TFO requires both the client and the ``mongod/mongos`` host machines support and enable TFO: Windows The following Windows operating systems support TFO: - Microsoft Windows Server 2016 or later. - Microsoft Windows 10 Update 1607 or later. macOS macOS 10.11 (El Capitan) and later support TFO Linux Linux operating systems running Linux Kernel 3.7 or later can support inbound TFO connections. Linux operating systems running Linux Kernel 4.11 or later can support both inbound and outbound TFO connections. Set the value of ``/proc/sys/net/ipv4/tcp_fastopen`` to enable support for inbound and/or outbound TFO connections: - Set to ``1`` to enable only outbound TFO connections - Set to ``2`` to enable only inbound TFO connections - Set to ``3`` to enable inbound and outbound TFO connections. MongoDB 4.4 adds the following parameters for controlling TFO: .. list-table:: :header-rows: 1 :widths: 30 70 * - Parameter - Description * - :parameter:`tcpFastOpenServer` - *Default*: ``true`` (Enabled) Enables or disables support for inbound TFO connections to the ``mongod/mongos`` * - :parameter:`tcpFastOpenClient` - *Default*: ``true`` (Enabled) *Linux Operating System Only* Enables or disables support for outbound TFO connections from the ``mongod/mongos``. * - :parameter:`tcpFastOpenQueueSize` - *Default*: ``1024`` Control the size of the queue of pending TFO connections. MongoDB 4.4 adds the following counters to the output of :dbcommand:`serverStatus` and :method:`db.serverStatus()`: .. list-table:: :header-rows: 1 :widths: 30 70 * - Counter - Description * - :serverstatus:`network.tcpFastOpen.kernelSetting` - *Linux only* Indicates kernel support for TFO. * - :serverstatus:`network.tcpFastOpen.serverSupported` - Indicates operating system support for incoming TFO connections. * - :serverstatus:`network.tcpFastOpen.clientSupported` - Indicates operating system support for outgoing TFO connections. * - :serverstatus:`network.tcpFastOpen.accepted` - Indicates the total number of accepted incoming TFO connections to the :binary:`mongod` / :binary:`mongos` since the ``mongod/mongos`` last started. A complete discussion of TFO is outside the scope of this documentation. For more information on TFO, start with the following external resources: - `RFC7413 TCP Fast Open `__ - `TCP Fast Open (en.wikipedia.org) `__ General Improvements -------------------- .. _4.4-rel-notes-sort-memory-limit: Blocking Sort Limit Increased ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If MongoDB cannot use an index or indexes to obtain the sort order for a given :method:`cursor.sort()` operation, MongoDB must perform a blocking sort on the data. A blocking sort indicates that MongoDB must consume and process all input documents to the sort before returning results. Blocking sorts do not block concurrent operations on the collection or database. Prior to MongoDB 4.4, MongoDB returned an error if a blocking sort operations required more than 32 megabytes of system memory. Starting in MongoDB 4.4, blocking sort operations increase the limit on system memory to use for the sort operation to 100 megabytes. For blocking sort operations which require more than 100 megabytes of system memory, MongoDB returns an error *unless* the query specifies :method:`cursor.allowDiskUse()` (*New in MongoDB 4.4*). For more information on sorting and index use, see :ref:`sort-index-use`. .. seealso:: - :method:`cursor.allowDiskUse()` - :limit:`Memory Limits on Sort Operations ` ``find`` Can Use Temporary Files To Support Large Non-Indexed Sorts ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MongoDB 4.4 adds a new option :ref:`allowDiskUse ` to the :dbcommand:`find` command. With :ref:`allowDiskUse: true `, the operation can use temporary files on disk when processing a non-indexed ("blocking") :ref:`sort ` operation that exceeds the 100 megabyte memory limit. Prior to MongoDB 4.4, a :dbcommand:`find` operation with a blocking sort failed if it exceeded the memory limit while processing the sort. For the :method:`db.collection.find()` shell method with :method:`cursor.sort()`, MongoDB 4.4 adds the :method:`cursor.allowDiskUse()` cursor modifier. :ref:`allowDiskUse ` and :method:`cursor.allowDiskUse()` have no effect if MongoDB can satisfy the sort using an :ref:`index `, *or* if the blocking sort requires less than 100 megabytes of memory. For instructions on enabling :ref:`allowDiskUse ` for queries issued through a MongoDB driver, defer to the documentation for your preferred :driver:`MongoDB 4.4-compatible driver `. .. seealso:: - :limit:`Memory Limits On Sort Operations ` - :ref:`sort-index-use` Collection Namespace Limit ~~~~~~~~~~~~~~~~~~~~~~~~~~ Starting in MongoDB 4.4, .. include:: /includes/fact-collection-namespace-limit.rst Validation Data Throughput Information ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. include:: /includes/extracts/4.4-validate-data-throughput.rst .. seealso:: :ref:`4.4-validate-method-signature` ``compact`` Behavior Change ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Blocking ```````` Starting in MongoDB 4.4, :dbcommand:`compact` only blocks the following metadata operations: - :method:`db.collection.drop` - :method:`db.collection.createIndex` and :method:`db.collection.createIndexes` - :method:`db.collection.dropIndex` and :method:`db.collection.dropIndexes` :dbcommand:`compact` does not block :ref:`crud` for the database it is currently operating on. Previously, :dbcommand:`compact` blocked all operations for the database it was operating on, including :ref:`crud`, and was therefore only appropriate for use during scheduled maintenance periods. ``force`` Option ```````````````` Starting in MongoDB 4.4, the ``force`` flag forces :dbcommand:`compact` to run on the :term:`primary` in a :term:`replica set`. Previously, the ``force`` option, when set to ``true`` enabled :dbcommand:`compact` to run on the :term:`primary` in a :term:`replica set` and if set to ``false``, returned an error when run on a :term:`primary`. .. seealso:: :ref:`compact` ``mongod --repair`` Behavior Change ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Starting in MongoDB 4.4, the :option:`mongod --repair` rebuilds all indexes for the following: - Collections with inconsistencies between the collection data and one or more indexes. - Salvaged and modified collections. In earlier versions of MongoDB, the :option:`mongod --repair` option rebuilt all indexes for all collections. ``serverStatus`` Output Change ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Field Name Change ````````````````` :dbcommand:`serverStatus` returns :serverstatus:`flowControl.locksPerKiloOp` instead of :serverstatus:`flowControl.locksPerOp`. New Fields `````````` :dbcommand:`serverStatus` includes the following new fields in its output: - Aggregation Metrics - :serverstatus:`metrics.aggStageCounters` *(Also available in 4.2.6+ and 4.0.19+)* - Connections Metrics - :serverstatus:`connections.exhaustIsMaster` - :serverstatus:`connections.awaitingTopologyChanges` - Default Read Concern Write Concern Metrics - :serverstatus:`defaultRWConcern` - :serverstatus:`defaultRWConcern.defaultReadConcern` - :serverstatus:`defaultRWConcern.defaultReadConcern.level` - :serverstatus:`defaultRWConcern.defaultWriteConcern` - :serverstatus:`defaultRWConcern.defaultWriteConcern.w` - :serverstatus:`defaultRWConcern.defaultWriteConcern.wtimeout` - :serverstatus:`defaultRWConcern.updateOpTime` - :serverstatus:`defaultRWConcern.updateWallClockTime` - :serverstatus:`defaultRWConcern.localUpdateWallClockTime` - :serverstatus:`metrics.getLastError.default` - :serverstatus:`metrics.getLastError.default.unsatisfiable` - :serverstatus:`metrics.getLastError.default.wtimeouts` - Latch Metrics - :serverstatus:`latchAnalysis` - Mirrored Reads Metrics - :serverstatus:`mirroredReads` - :serverstatus:`mirroredReads.seen` - :serverstatus:`mirroredReads.sent` - Query Execution Metrics - :serverstatus:`metrics.queryExecutor.collectionScans` - :serverstatus:`metrics.queryExecutor.collectionScans.nonTailable` - :serverstatus:`metrics.queryExecutor.collectionScans.total` - Replication Metrics - :serverstatus:`metrics.repl.network.replSetUpdatePosition.num` - :serverstatus:`metrics.repl.network.getmores.numEmptyBatches` - :serverstatus:`metrics.repl.network.oplogGetMoresProcessed` - :serverstatus:`metrics.repl.network.oplogGetMoresProcessed.num` - :serverstatus:`metrics.repl.network.oplogGetMoresProcessed.totalMillis` - :serverstatus:`metrics.repl.syncSource.numSelections` - :serverstatus:`metrics.repl.syncSource.numTimesChoseSame` - :serverstatus:`metrics.repl.syncSource.numTimesChoseDifferent` - :serverstatus:`metrics.repl.syncSource.numTimesCouldNotFind` - Network Metrics - :serverstatus:`network.numSlowDNSOperations` - :serverstatus:`network.numSlowSSLOperations` - Security Metrics - :serverstatus:`security.authentication.mechanisms` - Sharding Metrics - :serverstatus:`shardedIndexConsistency` - :serverstatus:`shardingStatistics.rangeDeleterTasks` - :serverstatus:`shardingStatistics.unfinishedMigrationFromPreviousPrimary` - :serverstatus:`shardingStatistics.numHostsTargeted` ``serverStatus`` Sharding Statistics Output Change ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :serverstatus:`shardingStatistics.numHostsTargeted` reports the number of shards targeted by CRUD operations and aggregation commands. It increments the relevant find, insert, update, delete or aggregate metric with each operation on a cluster. ``replSetGetStatus`` Output Change ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :dbcommand:`replSetGetStatus` returns the following new fields: - :data:`~replSetGetStatus.tooStale` - :data:`~replSetGetStatus.votingMembersCount` - :data:`~replSetGetStatus.writableVotingMembersCount` - :data:`initialSyncStatus.syncSourceUnreachableSince ` - :data:`initialSyncStatus.currentOutageDurationMillis ` - :data:`initialSyncStatus.totalTimeUnreachableMillis ` - :data:`initialSyncAttempts.rollBackId ` - :data:`initialSyncAttempts.operationsRetried ` - :data:`initialSyncAttempts.totalTimeUnreachableMillis ` .. _4.4-rel-notes-db-auth-passwordPrompt: db.auth() Can Prompt for Password ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Starting in MongoDB 4.4, the :binary:`~bin.mongo` shell method :ref:`db-auth-syntax-username-password` prompts for the password if you do not pass in the password or the :method:`passwordPrompt()` method for the ````. Support for ``$natural`` Sort on Views ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. include:: /includes/extracts/4.4-changes-natural-sort-views.rst Support for Diagnostic Backtrace Generation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. include:: /includes/diagnostic-backtrace-generation.rst For more information, see :ref:`sigusr2-diagnostic-backtrace`. Container-aware FTDC Reporting ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Starting in MongoDB 4.4, :ref:`FTDC ` now reports utilization data for a :binary:`~bin.mongod` running in a container from the perspective of the container, as opposed to the host operating system. See :ref:`ftdc-stub` for more information. Updated ``ulimit`` Startup Warning ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Starting in MongoDB 4.4, :binary:`~bin.mongod` logs a startup warning if a platform's configured ``ulimit`` value for number of open files is under ``64000``. Previously, a warning would only be logged if this value was under ``1000``. See :ref:`recommended-ulimit-settings` for more information. New ``replanReason`` Database Profiler Output Field ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MongoDB 4.4 adds the :data:`replanReason` field to :doc:`database profiler output ` and :doc:`diagnostic log messages `. The ``replanReason`` field contains the reason the query system evicted a :ref:`cached plan `. ``dbStats`` and ``collStats`` Output ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The :dbcommand:`dbStats` command and its :binary:`~bin.mongo` shell helper :method:`db.stats()` return: - :data:`~dbStats.totalSize`, which is the sum of :data:`~dbStats.storageSize` and :data:`~dbStats.indexSize`. The :dbcommand:`collStats` command, its :binary:`~bin.mongo` shell helper :method:`db.collection.stats()`, and the :pipeline:`$collStats` aggregation stage return: - :data:`~collStats.totalSize`, which is the sum of :data:`~collStats.storageSize` and :data:`~collStats.totalIndexSize`. - :data:`~collStats.freeStorageSize`, which is the amount of storage available for reuse. Hint Available for Additional Database Commands ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Starting in MongoDB 4.4, the following database commands can accept a ``hint`` argument to specify the index to use: - The :dbcommand:`delete` command and the associated :binary:`~bin.mongo` shell methods :method:`db.collection.deleteOne()` and :method:`db.collection.deleteMany()`. - The :dbcommand:`findAndModify` command and the associated :binary:`~bin.mongo` shell methods: - :method:`db.collection.findAndModify()`, - :method:`db.collection.findOneAndDelete()`, - :method:`db.collection.findOneAndReplace()`, - :method:`db.collection.findOneAndUpdate()` See: - :dbcommand:`delete` - :dbcommand:`findAndModify` JavaScript Execution on ``mongos`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Starting in MongoDB 4.4, MongoDB allows JavaScript execution on :binary:`~bin.mongos` instances. To disable JavaScript execution on a :binary:`~bin.mongos` instance: - Set :setting:`security.javascriptEnabled` configuration option to false, or - Specify the :option:`--noscripting ` command-line option. Earlier versions of MongoDB do not allow JavaScript execution on :binary:`~bin.mongos` instances. Global Default Read and Write Concern ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. note:: Requires ``featureCompatibilityVersion`` 4.4+ Each :binary:`~bin.mongod` in the replica set or sharded cluster *must* have :ref:`featureCompatibilityVersion ` set to at least ``4.4`` to configure global default read and write concern. Starting in MongoDB 4.4, replica sets and sharded clusters support configuring global default read and write concern settings. Clients which do not explicitly specify a given read or write concern setting inherit the corresponding global default setting. To configure default global default read or write concern, MongoDB adds the :dbcommand:`setDefaultRWConcern` administrative command. For replica sets, issue the command against the :term:`primary` member. For sharded clusters, issue the command from a :binary:`~bin.mongos`. To retrieve the global default read or write concern settings, MongoDB adds the :dbcommand:`getDefaultRWConcern` administrative command. Read Concern Provenance ``````````````````````` Starting in MongoDB 4.4, read concern objects may include a ``provenance`` field, indicating where the read concern originated. The following table shows the possible read concern ``provenance`` values and their significance: .. include:: /includes/fact-rc-provenance-table.rst If a read operation is logged or profiled, the operation entry contains the read concern object, including the ``provenance`` field. .. include:: /includes/fact-provenance-diagnostic.rst Write Concern Provenance ```````````````````````` Starting in MongoDB 4.4, write concern objects may include a ``provenance`` field, indicating where the write concern originated. The following table shows the possible write concern ``provenance`` values and their significance: .. include:: /includes/fact-wc-provenance-table.rst If a write operation is logged or profiled, the operation entry contains the write concern object, including the ``provenance`` field. .. include:: /includes/fact-provenance-diagnostic.rst ``currentOp`` Output ~~~~~~~~~~~~~~~~~~~~ - The :pipeline:`$currentOp` includes :data:`~$currentOp.dataThroughputAverage` and :data:`~$currentOp.dataThroughputLastSecond` information when reporting on validate operations in progress. - The :dbcommand:`currentOp` command includes :data:`~currentOp.dataThroughputAverage` and :data:`~currentOp.dataThroughputLastSecond` information when reporting on validate operations in progress. New KMIP Connection Parameters for ``mongod`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MongoDB 4.4 Enterprise introduces two new configuration settings to enhance the initial connection to a KMIP server, as part of Kerberos authentication: Connection Retries `````````````````` To control the number of times the :binary:`~bin.mongod` retries a failed initial connection to the KMIP server: - Set the :setting:`security.kmip.connectRetries` configuration option, or - Specify the :option:`mongod --kmipConnectRetries` command-line option. Connection Timeout `````````````````` To control the timeout, in milliseconds, to wait for the initial response from the KMIP server before giving up, or retrying: - Set the :setting:`security.kmip.connectTimeoutMS` configuration option, or - Specify the :option:`mongod --kmipConnectTimeoutMS` command-line option. These settings are available in MongoDB Enterprise only. New Startup Option for ``mongod`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The new :parameter:`processUmask` startup option for :binary:`~bin.mongod` allows you to set permissions through `umask `_ for groups and other users when :parameter:`honorSystemUmask` is set to ``false``. ``mapReduce`` Ignores ``verbose`` Option ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Starting with MongoDB 4.4, the :dbcommand:`mapReduce` command and the :method:`db.collection.mapReduce()` shell method ignore the :ref:`verbose ` option. ``explain`` Support for ``mapReduce`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Starting with MongoDB 4.4, you can use the :dbcommand:`explain` command or the :method:`db.collection.explain()` shell method to preview the results of :dbcommand:`mapReduce` or :method:`db.collection.mapReduce()`. Improvements to ``explain`` Results ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Starting in version 4.4: - :doc:`Explain results ` for commands run on sharded clusters include a top-level :ref:`serverInfo ` object for the :binary:`~bin.mongos` in addition to the ``serverInfo`` objects returned for each shard. This is also available in versions 4.2.2, 4.0.14, and 3.6.16. - :doc:`Explain results ` include the :ref:`serverInfo ` object when :data:`~explain.queryPlanner.optimizedPipeline` is ``true``. In previous versions of MongoDB, ``explain`` results would occasionally not include the ``serverInfo`` object when :data:`~explain.queryPlanner.optimizedPipeline` was ``true``. This is also available in versions 4.2.2, 4.0.14, and 3.6.16. - :doc:`Explain results ` for aggregation include the :data:`nReturned ` and :data:`executionTimeMillisEstimate ` fields for each :doc:`pipeline stage ` when you run :method:`db.collection.explain().aggregate() ` method in ``executionStats`` and ``allPlansExecution`` modes. .. seealso:: :doc:`Explain results `. ``comment`` Option Available to all Database Commands ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Starting in MongoDB 4.4, all database commands support specifying a ``comment`` field, in the following fashion: .. example:: .. code-block:: javascript db.runCommand( { , "comment" : }) Once set, the comment appears alongside records of the command in the following locations: - :ref:`mongod log messages `, in the ``attr.command.cursor.comment`` field. - :ref:`Database profiler ` output, in the :data:`command.comment ` field. - :dbcommand:`currentOp` output, in the :data:`command.comment ` field. A comment must be a valid :ref:`BSON object ` (string, integer, array, etc). Improvements to Positional ``$`` Operator ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Starting in MongoDB 4.4, when using the positional :projection:`$` operator, you can specify different array fields between the query document and projection document. For example, if you insert the following document into a collection: .. code-block:: javascript db.foo.insertOne( { a: [ "one", "two", "three" ], b: [ 1, 2, 3 ] } ) Starting in MongoDB 4.4, you can use the following query to project only the first element from field ``b`` for a document that matches the query specified on field ``a``: .. code-block:: javascript db.foo.findOne( { a: "one" }, { "b.$": 1 } ) .. important:: .. include:: /includes/fact-behavior-project-different-array.rst In previous versions of MongoDB, this operation fails because the array field being limited **must** appear in the query document. Changes Affecting Compatibility ------------------------------- Some changes can affect compatibility and may require user actions. For a detailed list of compatibility changes, see :doc:`/release-notes/4.4-compatibility`. .. _4.4-upgrade: Upgrade Procedures ------------------ .. important:: Feature Compatibility Version To upgrade from 4.2 deployment, the 4.2 deployment must have ``featureCompatibilityVersion`` set to ``4.2``. To check the version: .. code-block:: javascript db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } ) For specific details on verifying and setting the ``featureCompatibilityVersion`` as well as information on other prerequisites/considerations for upgrades, refer to the individual upgrade instructions: - :doc:`/release-notes/4.4-upgrade-standalone` - :doc:`/release-notes/4.4-upgrade-replica-set` - :doc:`/release-notes/4.4-upgrade-sharded-cluster` If you need guidance on upgrading to 4.4, `MongoDB professional services `_ offer major version upgrade support to help ensure a smooth transition without interruption to your MongoDB application. Download -------- To download MongoDB 4.4, go to the `MongoDB Download Center `_. .. seealso:: - `All Third Party License Notices `_. .. _4.4-known-issues: Known Issues ------------ .. list-table:: :header-rows: 1 :widths: 15 70 20 * - In Version - Issues - Status * - 4.4.0 - :issue:`SERVER-45042`: MongoDB Server Installation MSI for both Community and Enterprise no longer contain binaries for the :dbtools:`MongoDB Database Tools <>`. For more information, see :ref:`4.4-tools-compatibility`. - Unresolved * - 4.4.0 - :issue:`SERVER-49694`: On a sharded cluster, :readmode:`nearest` reads or :ref:`hedged reads ` may not be routed to a near shard replica. - Fixed in 4.4.1 * - 4.4.0 - :issue:`WT-6623`: Set the connection level file ID in recovery file scan. - Fixed in 4.4.1 Report an Issue --------------- To report an issue, see https://github.com/mongodb/mongo/wiki/Submit-Bug-Reports for instructions on how to file a JIRA ticket for the MongoDB server or one of the related projects. .. toctree:: /release-notes/4.4-compatibility /release-notes/4.4-upgrade-standalone /release-notes/4.4-upgrade-replica-set /release-notes/4.4-upgrade-sharded-cluster /release-notes/4.4-downgrade /release-notes/4.4-changelog