sh.enableAutoSplit() returns Documentations failed validation

Hi,

I’m trying to enable the autosplit and get this back from the mongos. I have googled as much as I can cannot find anyone having this issue so I turn to this forum if anyone has had this issue and am I just missing something simple here?

> sh.enableAutoSplit()
Uncaught:
MongoServerError: Document failed validation
Additional information: {
  failingDocumentId: 'autosplit',
  details: {
    operatorName: '$jsonSchema',
    schemaRulesNotSatisfied: [
      {
        operatorName: 'oneOf',
        schemasNotSatisfied: [
          {
            index: 0,
            details: [
              {
                operatorName: 'properties',
                propertiesNotSatisfied: [
                  {
                    propertyName: '_id',
                    details: [
                      {
                        operatorName: 'enum',
                        specifiedAs: { enum: [ 'chunksize' ] },
                        reason: 'value was not found in enum',
                        consideredValue: 'autosplit'
                      }
                    ]
                  }
                ]
              },
              {
                operatorName: 'additionalProperties',
                specifiedAs: { additionalProperties: false },
                additionalProperties: [ 'enabled' ]
              }
            ]
          },
          {
            index: 1,
            details: [
              {
                operatorName: 'properties',
                propertiesNotSatisfied: [
                  {
                    propertyName: '_id',
                    details: [
                      {
                        operatorName: 'enum',
                        specifiedAs: {
                          enum: [
                            'balancer',
                            'automerge',
                            'ReadWriteConcernDefaults',
                            'audit'
                          ]
                        },
                        reason: 'value was not found in enum',
                        consideredValue: 'autosplit'
                      }
                    ]
                  }
                ]
              }
            ]
          }
        ]
      }
    ]
  }
}

Hello @GaryxIO

Is this on a new MongoDB 8.0 sharded cluster?

Running sh.enableAutoSplit() on MongoDB 7.0 returns a deprecation warning:

sh.enableAutoSplit()
DeprecationWarning: Starting in MongoDB 6.0.3, automatic chunk splitting is not performed. This is because of balancing policy improvements. Auto-splitting commands still exist, but do not perform an operation. For details, see Balancing Policy Changes: https://mongodb.prakticum-team.ru/docs/manual/release-notes/6.0/#balancing-policy-changes

This is also returned on a 7.0 cluster upgraded to 8.0. But on a new 8.0 cluster I also receive the same output MongoServerError: Document failed validation. This may be a bug.

As the message from my output suggests the command is deprecated due to changes in the balancing policy.

Balancing Policy Changes

Starting in MongoDB 6.0.3, data in sharded clusters is distributed based on data size rather than number of chunks. Be aware of the following significant changes in sharded cluster data distribution behavior:

  • The balancer distributes ranges of data rather than chunks. The balancing policy looks for >evenness of data distribution rather than chunk distribution.
  • Chunks are not subject to auto-splitting. Instead, chunks are split only when moved across shards.
  • A chunk is now referred to as a range.
  • moveRange has replaced moveChunk.

Note

Starting in MongoDB 6.0.3, automatic chunk splitting is not performed. This is because of balancing policy improvements. Auto-splitting commands still exist, but do not perform an operation.

https://mongodb.prakticum-team.ru/docs/manual/release-notes/6.0/#balancing-policy-changes
https://mongodb.prakticum-team.ru/docs/manual/reference/method/sh.enableAutoSplit/#sh.enableautosplit

Hi Chris,

This is on a 8.0 sharded clusters. It’s not a new one. I thought it was just disabled, not removed in it’s entirety.

The wording in the documentation is confusing as it is still listed there as a valid command. Is there any way to actually get clarity if this has been disabled or not?