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

Skipping if local non-timeseries collection exists check when creating a sharded timeseries collection

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 5.0.0, 6.0.0, 7.0.0, 7.1.0, 7.3.0-rc0, 7.2.0
    • Component/s: None
    • None
    • Catalog and Routing
    • ALL
    • v8.0, v7.3, v7.0, v6.0, v5.0
    • Hide
      assert.commandWorked(db.runCommand({create: coll.getName()}));
      
      // Following shard command doesn't return an error but has to.
      assert.commandFailedWithErrorCode(db.adminCommand({
              shardCollection: coll.getFullName(),
              key: {time: 1},
              timeseries: {timeField: 'time', metaField: 'meta'}
          }),
          [ErrorCodes.NamespaceExist]);
      
      Show
      assert.commandWorked(db.runCommand({create: coll.getName()})); // Following shard command doesn't return an error but has to. assert.commandFailedWithErrorCode(db.adminCommand({ shardCollection: coll.getFullName(), key: {time: 1}, timeseries: {timeField: 'time', metaField: 'meta'} }), [ErrorCodes.NamespaceExist]);
    • 2

      Currently, we can create a sharded timeseries collection even if that collection already exists as an unsharded non-timeseries collection.

      That's because we are skipping the check to local catalog collection options when the create request is not unsplittable.

            Assignee:
            Unassigned Unassigned
            Reporter:
            silvia.surroca@mongodb.com Silvia Surroca
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: