Erasure coding

更新时间:
复制 MD 格式

Erasure coding (EC) reduces storage overhead while maintaining the same data availability—lowering your storage costs with no change in fault tolerance. Enable EC on a LindormTable table by setting the EC_POLICY parameter at table creation time.

How it works

EC splits original data into k data blocks and generates m redundant blocks using specific algorithms. Any k blocks out of the total k+m are sufficient to reconstruct the original data. The storage overhead factor is (k+m) / k.

For the recommended RS-4-2 algorithm (k=4, m=2):

PropertyValue
Storage overhead factor(4+2) / 4 = 1.5x
Equivalent replicas1.5 replicas of original data
Fault toleranceUp to 2 corrupted or missing blocks
Node distributionData spread across 6 nodes
Standby nodes required1 additional node

Data is converted to EC format when a compaction operation runs—not immediately after you enable EC on a table.

Prerequisites

Before you enable erasure coding, make sure you have:

Limitations

  • Storage type: EC is supported only on Lindorm instances that use local HDDs. Instances using cloud disks are not supported.

    Important

    To enable EC on a single-zone or multi-zone Lindorm instance that uses local SSDs, contact technical support (DingTalk ID: s0s3eg3) to confirm compatibility.

  • Minimum nodes: The instance must have at least 7 nodes. With RS-4-2, data is distributed across 6 nodes. One additional node is required to ensure writes succeed when one of the 6 nodes fails, bringing the minimum to 4+2+1 = 7 nodes.

Enable erasure coding

Set the EC_POLICY parameter when creating a table. Use RS-4-2 for the best balance of storage efficiency and recovery performance.

CREATE TABLE dt (p1 integer, p2 integer, PRIMARY KEY(p1)) WITH (EC_POLICY = 'RS-4-2');
Note

RS-4-2 stores 1.5 replicas of original data and supports full data recovery. To use an algorithm with lower overhead (such as 8+2 or 8+3), contact technical support (DingTalk ID: s0s3eg3).

Manage erasure coding

Change the EC algorithm:

ALTER TABLE dt SET 'EC_POLICY' = 'RS-4-2';

Remove erasure coding from a table:

ALTER TABLE dt SET 'EC_POLICY' = '';

After removing EC_POLICY, trigger a major compaction and wait until the EC block count drops to 0.

View EC data

  1. Open the Instance Monitoring page in the Lindorm console. See View monitoring information in the Lindorm console.

  2. Click Cluster Storage Details.

  3. In the EC file logical data chart, review the EC data written to the instance.

FAQ

EC data is not written after I enabled erasure coding. What should I check?

Verify these three conditions:

  • LindormTable version is 2.5.4 or later

  • The instance has at least 7 nodes

  • A major compaction has been triggered (EC conversion happens during compaction, not immediately)

If all three conditions are met and the issue persists, contact technical support (DingTalk ID: s0s3eg3).

Does Lindorm support EC algorithms other than RS-4-2, such as 8+2 or 8+3?

Yes. Contact technical support (DingTalk ID: s0s3eg3) to configure a different algorithm.

I cannot remove a node from my instance. Why?

Lindorm instances using local disks cannot linearly scale down storage—you can only reduce storage by removing nodes. An instance with EC enabled has a minimum node requirement based on the algorithm. With RS-4-2, the minimum is 7 nodes (4+2+1).

To remove a node safely:

  1. Remove EC_POLICY from all tables: ALTER TABLE dt SET 'EC_POLICY' = ''

  2. Trigger a major compaction.

  3. Wait until the EC block count reaches 0.

  4. Remove the node.