Skip to content

[ISSUE #10438] Fix buildTopicConfigSerializeWrapper exposing live topicConfigTable reference#10439

Open
chuanxo wants to merge 1 commit into
apache:developfrom
chuanxo:fix/issue-10438-snapshot-serialize-wrapper
Open

[ISSUE #10438] Fix buildTopicConfigSerializeWrapper exposing live topicConfigTable reference#10439
chuanxo wants to merge 1 commit into
apache:developfrom
chuanxo:fix/issue-10438-snapshot-serialize-wrapper

Conversation

@chuanxo

@chuanxo chuanxo commented Jun 7, 2026

Copy link
Copy Markdown

Summary

  • buildTopicConfigSerializeWrapper() 直接将 this.topicConfigTable 引用设入 wrapper,与 dataVersion 的 copy 之间存在并发不一致
  • 修复:先 copy dataVersion,再用 new ConcurrentHashMap<>(this.topicConfigTable) 做浅拷贝,保证 wrapper 是 point-in-time 一致快照

Fixes #10438

Test plan

  • 新增 testSerializeWrapperIsSnapshot 验证 wrapper 持有独立 snapshot,后续写入不可见
  • 全量 TopicConfigManagerTest 13 个用例通过
  • checkstyle 0 violations

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 47.98%. Comparing base (7e0cec3) to head (fb6a6a2).

Additional details and impacted files
@@              Coverage Diff              @@
##             develop   #10439      +/-   ##
=============================================
- Coverage      48.04%   47.98%   -0.07%     
+ Complexity     13305    13290      -15     
=============================================
  Files           1377     1377              
  Lines         100613   100613              
  Branches       12992    12992              
=============================================
- Hits           48341    48278      -63     
- Misses         46354    46398      +44     
- Partials        5918     5937      +19     

☔ 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.

[Bug] buildTopicConfigSerializeWrapper() exposes live topicConfigTable reference causing version-data inconsistency

3 participants