Skip to content

[Fix] Keep heartbeat alive when metadata lease is fenced - #18343

Open
Caideyipi wants to merge 2 commits into
masterfrom
fix/heartbeat-metadata-lease-fence
Open

[Fix] Keep heartbeat alive when metadata lease is fenced#18343
Caideyipi wants to merge 2 commits into
masterfrom
fix/heartbeat-metadata-lease-fence

Conversation

@Caideyipi

@Caideyipi Caideyipi commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Description

  • build schema quota count maps on snapshots and publish them to the heartbeat response only after both device and series counts succeed
  • catch MetadataLeaseFencedException while collecting schema counts so the DataNode heartbeat can still complete
  • omit both region device and series usage maps after this failure, preventing ConfigNode from applying partial schema count updates
  • emit a localized warning and add regression coverage for both method-level atomicity and the fenced-heartbeat path

Tests

  • mvn -nsu test -pl iotdb-core/datanode -Dtest=DataNodeInternalRPCServiceImplTest#testHeartbeatSkipsSchemaUsageWhenMetadataLeaseIsFenced
  • mvn -o -nsu test-compile -pl iotdb-core/datanode -P with-zh-locale -DskipTests

@Caideyipi
Caideyipi force-pushed the fix/heartbeat-metadata-lease-fence branch from a7734ac to 7dc9d05 Compare July 29, 2026 03:47
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.60606% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.43%. Comparing base (4861027) to head (48b5374).
⚠️ Report is 11 commits behind head on master.

Files with missing lines Patch % Lines
...ol/thrift/impl/DataNodeInternalRPCServiceImpl.java 47.05% 9 Missing ⚠️
...org/apache/iotdb/db/schemaengine/SchemaEngine.java 75.00% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #18343      +/-   ##
============================================
+ Coverage     43.14%   43.43%   +0.29%     
  Complexity      374      374              
============================================
  Files          5364     5366       +2     
  Lines        382623   382978     +355     
  Branches      49749    49815      +66     
============================================
+ Hits         165077   166347    +1270     
+ Misses       217546   216631     -915     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant