Skip to content

ManagePartitioningDialog: cannot disable split-by-size or change settings when it is already disabled #3886

Description

@krasnovdm

Describe the bug

Two related bugs in the Manage Partitioning dialog (Diagnostics → Overview → gear icon):

Bug 1 — Cannot disable split-by-size

When a table has size-based auto-partitioning enabled, there is no toggle to disable it. Setting the "Split Size" field to 0 makes the Apply button inactive because splitSize is validated as a required positive number (> 0).

Bug 2 — Cannot change any settings when split-by-size is already disabled

When a table has size-based auto-partitioning disabled (SizeToSplit = 0), the dialog opens with split size showing 0 B. This immediately fails form validation (same > 0 requirement), so the Apply button is disabled from the start. Users cannot change MIN/MAX partition count either.

Root cause

src/containers/Tenant/Diagnostics/Overview/TableInfo/ManagePartitioningDialog/utils.ts:

splitSize: requiredPositiveNumber(i18n('error_required')),
// requiredPositiveNumber uses z.coerce.number().gt(0) — always required

The form has no "enable/disable split by size" toggle (splitSizeEnabled), so there is no way to make splitSize optional. Additionally, tablePartitioning.ts always generates AUTO_PARTITIONING_BY_SIZE = ENABLED in the SQL, so disabling is not even wired to the API layer.

Steps to reproduce

Bug 1:

  1. Open Diagnostics → Overview for a table with size-based auto-partitioning enabled
  2. Click the gear icon → Manage Partitioning
  3. Try to set "Split Size" to 0 → Apply becomes inactive

Bug 2:

  1. Create a table with AUTO_PARTITIONING_BY_SIZE = DISABLED
  2. Open Manage Partitioning dialog for that table
  3. The Apply button is inactive immediately; changing MIN/MAX has no effect

Expected behavior

  • A toggle to enable/disable size-based auto-partitioning
  • When disabled: form is valid without a split size value; MIN/MAX can be changed independently
  • When enabled: split size is required and must be > 0
  • Generated SQL uses AUTO_PARTITIONING_BY_SIZE = DISABLED when turned off

Workaround

ALTER TABLE `<path>` SET (AUTO_PARTITIONING_BY_SIZE = DISABLED);
-- or to change min/max without changing size mode:
ALTER TABLE `<path>` SET (
    AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 10,
    AUTO_PARTITIONING_MAX_PARTITIONS_COUNT = 100
);

Metadata

Metadata

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions