# ATTACH LEAF ALL

The `ATTACH LEAF ALL` command attaches all leaves in a cluster that are currently in the `detached` state.

## Syntax

```sql
ATTACH LEAF ALL [FORCE] [NO REBALANCE]

```

## Remarks

* `ATTACH LEAF ALL` is equivalent to running `ATTACH LEAF` on every leaf in a cluster that is currently in the `detached` state. If you want the leaves to fully rebalance after reattaching, you must run `REBALANCE PARTITIONS` afterward. This will rebalance and synchronize all partitions in one operation.

  To avoid the partial rebalance that is run automatically (after `attach_rebalance_delay_seconds`), use `ATTACH LEAF ALL NO REBALANCE`.
* `FORCE` is optional. Using `FORCE` overrides any conflicts that would prevent `ATTACH LEAF ALL` from running. In practice, this happens when the data on the leaf has diverged away from the current state of the cluster (for example, a database was recreated while the leaf was down).
* Detached leaves automatically reattach. To disable this feature, set the global variable `auto_attach` to `false`. For more information see [SET GLOBAL](https://docs.singlestore.com/db/v9.1/reference/sql-reference/operational-commands/set-global.md) .
* This command must be run on the master aggregator node (see [Node Requirements for SingleStore Commands](https://docs.singlestore.com/db/v9.1/reference/sql-reference/cluster-management-commands.md) ).
* This command causes implicit commits. Refer to [COMMIT](https://docs.singlestore.com/db/v9.1/reference/sql-reference/data-manipulation-language-dml/commit.md) for more information.
* Refer to the [Permissions Matrix](https://docs.singlestore.com/db/v9.1/reference/sql-reference/security-management-commands/permissions-matrix.md) for the required permissions.

## Example

```sql
ATTACH LEAF ALL;

```

```output

Query OK, 1 row affected (0.99 sec)

```

**Related Topics**

* [ATTACH LEAF](https://docs.singlestore.com/db/v9.1/reference/sql-reference/cluster-management-commands/attach-leaf.md)

***

Modified at: June 11, 2026

Source: [/db/v9.1/reference/sql-reference/cluster-management-commands/attach-leaf-all/](https://docs.singlestore.com/db/v9.1/reference/sql-reference/cluster-management-commands/attach-leaf-all/)

(An index of the documentation is available at /llms.txt)
