Uploaded image for project: 'Compass '
  1. Compass
  2. COMPASS-9124

Investigate changes in SERVER-82025: A update without shard key that no-ops does not report error about 'c' field being unsupported for non-pipeline updates

    • Type: Icon: Investigation Investigation
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • No version
    • Affects Version/s: None
    • Component/s: None
    • None
    • Not Needed
    • Developer Tools

      Original Downstream Change Summary

      When running an update or bulkWrite command with an update that contains a non-pipeline update in its u field, it is not allowed to specify any constants in the update's c field. This has always been the case, but so far hasn't been enforced for no-op updates.

      Our documentation states the following about the c field:

      > Optional. You can specify c only if u is a pipeline.

      This constraint however was so far not enforced for no-op updates, e.g. when the document to update did not exist.
      This change will enforce the constraint for all update operations, regardless of whether they are no-ops or actual updates.

      In case the c field is specified and the u field does not contain a pipeline update, error code 51198 with message Constant values may only be specified for pipeline updates is now consistently returned.
      Previously it was only returned for updates that were actually executed.

      Description of Linked Ticket

      For a non-pipeline update that uses the 'c' field, if we actually end up targeting any shards, we end up getting an error stating that isn't supported. 

      However, if the update doesn't end up being sent to any shards because it is a write without shard key and we find no shards to target via the read phase in the two-phase write protocol, then we do not error. 

            Assignee:
            rhys.howell@mongodb.com Rhys Howell
            Reporter:
            backlog-server-pm Backlog - Core Eng Program Management Team
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: