Skip to content

KAFKA-19597: Stop the RSM after closing the remote-log reader threads to handle requests gracefully #20342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 19, 2025

Conversation

kamalcph
Copy link
Contributor

@kamalcph kamalcph commented Aug 12, 2025

During shutdown, when the RSM closes first, then the ongoing requests
might throw an error. To handle the ongoing requests gracefully, closing
the RSM after closing the remote-log reader thread pools.

Reviewers: Satish Duggana [email protected]

… to handle requests gracefully

During shutdown, when the RSM closes first, then the ongoing requests might throw an error. To handle the ongoing requests gracefully, closing the RSM after closing the remote-log reader thread pools.
@github-actions github-actions bot added triage PRs from the community storage Pull requests that target the storage module tiered-storage Related to the Tiered Storage feature small Small PRs labels Aug 12, 2025
@kamalcph
Copy link
Contributor Author

@satishd @showuon

Call for review. PTAL. Thanks!

Copy link
Member

@satishd satishd left a comment

Choose a reason for hiding this comment

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

Thanks @kamalcph for the PR. LGTM.

@kamalcph kamalcph merged commit f0c3d93 into apache:trunk Aug 19, 2025
24 checks passed
@github-actions github-actions bot removed the triage PRs from the community label Aug 20, 2025
@kamalcph kamalcph deleted the KAFKA-19597 branch August 20, 2025 05:01
Copy link
Member

@chia7712 chia7712 left a comment

Choose a reason for hiding this comment

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

@kamalcph sorry for the late reviews. I leave two questions. Please take a look

leaderCopyRLMTasks.clear();
leaderExpirationRLMTasks.clear();
followerRLMTasks.clear();

Utils.closeQuietly(indexCache, "RemoteIndexCache");
Copy link
Member

Choose a reason for hiding this comment

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

Could you please add comments explaining the new close order? Otherwise, it might be unintentionally changed in the future

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Followed caller -> callee pattern. RemoteIndexCache invokes remoteStorageManagerPlugin to fetch the indexes so changed the shutdown order.

Copy link
Member

Choose a reason for hiding this comment

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

Followed caller -> callee pattern. RemoteIndexCache invokes remoteStorageManagerPlugin to fetch the indexes so changed the shutdown order.

yes, that is good pattern. BTW, it looks like fetchQuotaMetrics and copyQuotaMetrics are excluded by the removeMetrics. Is that expected?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

seems to be a miss to me.

Copy link
Member

Choose a reason for hiding this comment

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

thanks for confirmation. We will file a minor PR for it.

Copy link
Member

Choose a reason for hiding this comment

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

open #20394

kamalcph pushed a commit that referenced this pull request Aug 23, 2025
- Changes: Remove  fetchQuotaMetrics and copyQuotaMetrics in RemoteLogManager on close

from: #20342 (comment)

Reviewers: Kamal Chandraprakash <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
small Small PRs storage Pull requests that target the storage module tiered-storage Related to the Tiered Storage feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants