Skip to content

[Test] Fix the metadata lease override in DataNode unit tests - #18953

Merged
jt2594838 merged 1 commit into
apache:masterfrom
Caideyipi:fix/datanode-ut-metadata-lease-check
Oct 21, 2026
Merged

jt2594838 merged 1 commit into
apache:masterfrom
Caideyipi:fix/datanode-ut-metadata-lease-check

Conversation

@Caideyipi

Copy link
Copy Markdown
Collaborator

Description

The shared DataNode unit-test configuration sets metadata_lease_fence_ms, which is read only by ConfigNode. DataNode therefore keeps its default 500 ms lease check interval and fences its metadata caches after 20 seconds without ConfigNode heartbeats. This reproduces on current master and causes the five AnalyzerTest errors reported in #18937.

Replace that ineffective override with check_dn_lease_status_interval_ms=9223372036854775807, the key read by IoTDBDescriptor and used by MetadataLeaseManager. This restores the intent of #18284 in the shared unit-test configuration. Lease-specific tests continue to exercise expiry using independent managers and injected clocks.

Validation

  • On unmodified master (9ffa89327f8), initialize the singleton lease manager, wait 21.5 seconds without heartbeats, then run the five affected AnalyzerTest methods: all five fail with MetadataLeaseFencedException; the effective check interval is still 500 ms.

  • Repeat the same delayed probe with this one-line change: all five pass and the singleton remains unfenced; the effective check interval is Long.MAX_VALUE.

  • AnalyzerTest, MetadataLeaseManagerTest, DataNodeTableCacheLeaseTest, TreeDeviceSchemaCacheManagerLeaseTest, PartitionCacheLeaseTest, and ClusterAuthorityFetcherLeaseTest: 41 tests, 0 failures, 0 errors, 1 skipped. The 28-module reactor passed using:

    mvn -o -B -ntp -pl iotdb-core/datanode -am -Dmaven.compiler.useIncrementalCompilation=false -Dtest=AnalyzerTest,MetadataLeaseManagerTest,DataNodeTableCacheLeaseTest,TreeDeviceSchemaCacheManagerLeaseTest,PartitionCacheLeaseTest,ClusterAuthorityFetcherLeaseTest -DfailIfNoTests=false -Dsurefire.failIfNoSpecifiedTests=false test
    
  • Checkstyle and Spotless checks: passed.

  • git diff --check: passed.

This PR has:

  • been self-reviewed.

Use the DataNode check interval instead of the ConfigNode fence threshold so unit tests without ConfigNode heartbeats do not fence shared metadata caches after 20 seconds.
@alpass163

Copy link
Copy Markdown
Contributor

looks good to me

@jt2594838
jt2594838 merged commit 6ca9cd9 into apache:master Oct 21, 2026
38 of 39 checks passed
@jt2594838
jt2594838 deleted the fix/datanode-ut-metadata-lease-check branch October 21, 2026 07:46
VGalaxies pushed a commit to VGalaxies/iotdb that referenced this pull request Oct 26, 2026
…#18953)

Use the DataNode check interval instead of the ConfigNode fence threshold so unit tests without ConfigNode heartbeats do not fence shared metadata caches after 20 seconds.
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.

3 participants