Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-50750

Refining shard key to include nested field causes "Error refreshing cached collection" on shard primaries

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 4.4.0
    • Fix Version/s: 4.8.0, 4.4.2
    • Component/s: Sharding
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v4.4
    • Sprint:
      Sharding 2020-09-21
    • Linked BF Score:
      0

      Description

      If a shard key is refined (using refineCollectionShardKey) to include a nested field (e.g. key {a: 1} is refined to be {a: 1, "b.c": 1}), the resulting chunk boundaries will include nested documents, which is not a valid format.

      This causes future metadata refreshes to fail, with shard primaries logging "Error refreshing cached collection" messages like:

      {"t":{"$date":"2020-09-03T14:16:18.513-07:00"},"s":"I",  "c":"SH_REFR",  "id":24103,   "ctx":"ConfigServerCatalogCacheLoader-10","msg":"Error refreshing cached collection","attr":{"namespace":"XXX.XXXX","durationMillis":2,"error":"ConflictingOperationInProgress: Not all elements of { i: MinKey, j: MinKey, k: { nested: MinKey } } are of type minKey"}}
      

      refineCollectionShardKey should create boundaries with dotted field names instead of nested documents.

      It is possible to manually correct chunk and zone range metadata, but currently the best course of action is to avoid using refineShardKey to incorporate a nested field into the shard key.

      A test refining the shard key with a new dotted field has temporarily been commented waiting for this issue to be addressed.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jack.mulrow Jack Mulrow
              Reporter:
              jack.mulrow Jack Mulrow
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: