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):
| Property | Value |
|---|---|
| Storage overhead factor | (4+2) / 4 = 1.5x |
| Equivalent replicas | 1.5 replicas of original data |
| Fault tolerance | Up to 2 corrupted or missing blocks |
| Node distribution | Data spread across 6 nodes |
| Standby nodes required | 1 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:
LindormTable version 2.5.4 or later. See Release notes of LindormTable and Upgrade the minor engine version of a Lindorm instance
LindormDFS version 4.3.4 or later
An instance with at least 7 nodes (see Limitations)
An instance using local HDDs (see Limitations)
Limitations
Storage type: EC is supported only on Lindorm instances that use local HDDs. Instances using cloud disks are not supported.
ImportantTo 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');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
Open the Instance Monitoring page in the Lindorm console. See View monitoring information in the Lindorm console.
Click Cluster Storage Details.
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:
Remove
EC_POLICYfrom all tables:ALTER TABLE dt SET 'EC_POLICY' = ''Trigger a major compaction.
Wait until the EC block count reaches 0.
Remove the node.