Cyb/metadata table#18127
Conversation
…lity of table metadata operation procedure
…ager, add the scheduled task to check the status of metadata
# Conflicts: # iotdb-core/confignode/src/main/i18n/zh/org/apache/iotdb/confignode/i18n/ProcedureMessages.java # iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/env/ConfigNodeProcedureEnv.java # iotdb-core/datanode/src/main/i18n/zh/org/apache/iotdb/db/i18n/DataNodePipeMessages.java # iotdb-core/datanode/src/main/i18n/zh/org/apache/iotdb/db/i18n/DataNodeSchemaMessages.java
…m CommonConfig to the IoTDBConfig
|
I reviewed this PR against the HA requirement/design docs. The direction looks good, but I found several issues that should be addressed before merge:
The design says the ConfigNode should track whether each DataNode supports self-fencing, with default
For example, Overall, the main concept is sound, but the above issues affect the safety and compatibility of the lease-based HA mechanism. |
# Conflicts: # iotdb-core/datanode/src/test/java/org/apache/iotdb/db/schemaengine/table/DataNodeTableCacheTest.java
This PR introduces a lease-based self-fencing framework to enable high
availability for table metadata operations. It prevents DataNodes from
serving stale schema during network partitions.
Problem
Currently, in a cluster deployment (e.g., 1 ConfigNode, 3 DataNodes),
metadata operations lack true high availability. If a single DataNode (DN)
crashes or experiences a network partition, execution of DDL procedures
(such as Create/Alter/Drop Table, View management, TTL adjustments, and
Drop Database) will directly fail and trigger a rollback.
Solution
Lease Mechanism
Uses monotonic clock. Self-fences (clears cache, blocks reads/writes) if no
heartbeat received within metadata_lease_fence_ms (T_fence).
fenced DataNode.
Broadcast Coordination
heartbeat response per DataNode. Separately maintained from load-balancing
samples to ensure correctness.
DataNodes have been silent for T_proceed = T_fence + margin, WAIT
otherwise, FAIL when retry budget exhausted.
waiting up to T_proceed for unresponsive DataNodes to prove self-fenced.
Schema Change Integration
ClusterCachePropagator before proceeding.
transitions.
changes.
Configuration
iotdb-system.properties.template).
Testing
MetadataBroadcastVerdict, ClusterCachePropagator
ClusterAuthorityFetcher
Key Components Added
self-fencing upon expiration.
timestamp for each DataNode.
a fencing-aware retry mechanism.
DataNodes are logically safe to skip.
thrown on a fenced DataNode.
ensure safe schema deletion.