You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a shard receives its first command that contains a dbVersion, the shard
506
+
returns a StaleDbVersion error and the Mongos retries the operation. In a
507
+
sharded transaction, Mongos does not retry these operations and instead returns
508
+
the error to the client. For example::
509
+
510
+
Command distinct failed: Transaction aa09e296-472a-494f-8334-48d57ab530b6:1 was aborted on statement 0 due to: an error from cluster data placement change :: caused by :: got stale databaseVersion response from shard sh01 at host localhost:27217 :: caused by :: don't know dbVersion.
511
+
512
+
To workaround this limitation, a driver test runner MUST run a
513
+
non-transactional ``distinct`` command on each Mongos before running any test
514
+
that uses ``distinct``. To ease the implementation drivers can simply run
515
+
``distinct`` before *every* test.
516
+
517
+
Note that drivers can remove this workaround once `SERVER-39704`_ is resolved
518
+
so that mongos retries this operation transparently. The ``distinct`` command
519
+
is the only command allowed in a sharded transaction that uses the
520
+
``dbVersion`` concept so it is the only command affected.
0 commit comments