Skip to content

fix: avoid snapshot-read close metadata NPE - #3655

Open
Gezi-lzq wants to merge 1 commit into
mainfrom
fix/snapshot-read-close-main
Open

Gezi-lzq wants to merge 1 commit into
mainfrom
fix/snapshot-read-close-main

Conversation

@Gezi-lzq

@Gezi-lzq Gezi-lzq commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Why

Snapshot-read ElasticLog instances do not own a MetaStream or ElasticLogSegmentManager, but the normal close path attempted to use those components during partition removal or replacement. This caused SNAPSHOT_SUBSCRIBE_ERROR through a NullPointerException.

Backport: #3654 from 1.8 to main.

What

  • Use a dedicated close path for snapshot-read logs.
  • Close local segments and snapshot data streams without running normal metadata handoff, metadata persistence, or active-segment flush.
  • Keep the normal ElasticLog close path unchanged.
  • Avoid installing the normal lazy metadata listener for snapshot-read logs.

Test

The regression test applies real snapshot segment metadata, closes the snapshot-read log, and verifies that its data streams are closed.

Verification

./gradlew core:S3UnitTest --tests kafka.log.streamaspect.ElasticLogTest.testSnapshotReadCloseSkipsMetadataLifecycle passed.

@Gezi-lzq
Gezi-lzq enabled auto-merge (squash) October 13, 2026 08:43

This branch has not been deployed

No deployments
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.

2 participants