Skip to content

chore: clarify callback responsibility and remove redundant topic cleanup logic - #3542

Merged
Gezi-lzq merged 1 commit into
AutoMQ:mainfrom
BackendArchitectX:BackendArchitectX/refactor-2721-callback-cleanup
Oct 11, 2026
Merged

Gezi-lzq merged 1 commit into
AutoMQ:mainfrom
BackendArchitectX:BackendArchitectX/refactor-2721-callback-cleanup

Conversation

@BackendArchitectX

Copy link
Copy Markdown
Contributor

What changed

  • Remove the redundant deleted-topic traversal from ElasticReplicaManager#asyncApplyDelta.
  • Preserve callbacks for actual local partition deletion and partition state transitions.
  • Document the callback's immediate per-partition notification responsibility.

Why

Global deleted-topic cleanup is already handled by BrokerMetadataPublisher#notifyGroupCoordinatorOfDeletedPartitions after asyncApplyDelta completes. The additional deletedTopicIds() traversal in ElasticReplicaManager therefore caused redundant cleanup notifications.

Fixes #2721

Testing

  • :core:compileScala — passed
  • :core:S3UnitTest --tests unit.kafka.server.streamaspect.ElasticReplicaManagerTest — passed

@BackendArchitectX
BackendArchitectX force-pushed the BackendArchitectX/refactor-2721-callback-cleanup branch from f34a713 to 7df567a Compare September 8, 2026 12:02
@BackendArchitectX

Copy link
Copy Markdown
Contributor Author

Hi @superhx @Gezi-lzq @1sonofqiu, gentle ping on this PR when you have a chance.

I’ve kept the change tightly scoped to #2721: it removes only the redundant deleted-topic callback traversal, preserves callbacks for actual local partition deletion and state transitions, and leaves BrokerMetadataPublisher unchanged. I also added a regression test verifying that non-local partitions of a deleted topic no longer trigger the callback.

The branch is rebased on the latest main and CI is fully green. Happy to address any feedback.

@Gezi-lzq

Gezi-lzq commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution. I will conduct a review this week!

@Gezi-lzq Gezi-lzq left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Gezi-lzq Gezi-lzq changed the title refactor: clarify callback responsibility and remove redundant topic cleanup logic chore: clarify callback responsibility and remove redundant topic cleanup logic Sep 16, 2026
@BackendArchitectX

Copy link
Copy Markdown
Contributor Author

Thanks for the review @Gezi-lzq. Since the PR is approved and remains clean to merge, please let me know if anything else is needed from my side.

@BackendArchitectX

Copy link
Copy Markdown
Contributor Author

Hi @Gezi-lzq

Just following up on #3542 when you have a chance.

Thank you again for reviewing and approving the PR. Since all checks are passing and the branch remains clean to merge would you be able to help with the final merge when convenient?

If anything further is needed from my side I’d be happy to address it.

Thank you for your time!

@BackendArchitectX

Copy link
Copy Markdown
Contributor Author

Hi @Gezi-lzq,

Hope you're doing well! Thank you again for reviewing and approving PR #3542.

Since all checks are passing and the PR is ready to merge, I wanted to kindly check if there's anything further needed from my side or if you could help guide it toward merging.

Really appreciate your time and support!

@Gezi-lzq

Copy link
Copy Markdown
Contributor

I've already approved it, can't you merge it here? @BackendArchitectX

@BackendArchitectX

Copy link
Copy Markdown
Contributor Author

Hi @Gezi-lzq, thank you for approving the PR. I’m unable to merge it from my side because I don’t have the required permissions. Could you please help merge it or connect me with the maintainer who can? Thank you.

@Gezi-lzq
Gezi-lzq merged commit 5f4244e into AutoMQ:main Oct 11, 2026
8 checks passed
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.

refactor: clarify callback responsibility and remove redundant topic cleanup logic

2 participants