Skip to content

KAFKA-15265: Integrate RLMQuotaManager for throttling copies to remote storage#15820

Merged
satishd merged 2 commits intoapache:trunkfrom
abhijeetk88:KAFKA-15434_copy_quota
Jun 12, 2024
Merged

KAFKA-15265: Integrate RLMQuotaManager for throttling copies to remote storage#15820
satishd merged 2 commits intoapache:trunkfrom
abhijeetk88:KAFKA-15434_copy_quota

Conversation

@abhijeetk88
Copy link
Copy Markdown
Contributor

@abhijeetk88 abhijeetk88 commented Apr 27, 2024

In this PR, I have added the integration of the quota manager to throttle copy requests to the remote storage. Reference KIP-956

Added unit-tests for the copy throttling logic.

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

@abhijeetk88 abhijeetk88 marked this pull request as draft April 27, 2024 05:19
@abhijeetk88 abhijeetk88 force-pushed the KAFKA-15434_copy_quota branch 2 times, most recently from 3593def to 645ab37 Compare May 24, 2024 08:42
@abhijeetk88 abhijeetk88 changed the title [WIP] Kafka 15434: Integrate RLMQuotaManager for throttling copies to remote storage Kafka 15434: Integrate RLMQuotaManager for throttling copies to remote storage May 24, 2024
@abhijeetk88 abhijeetk88 changed the title Kafka 15434: Integrate RLMQuotaManager for throttling copies to remote storage Kafka-15625: Integrate RLMQuotaManager for throttling copies to remote storage May 24, 2024
@abhijeetk88 abhijeetk88 marked this pull request as ready for review May 24, 2024 08:51
@abhijeetk88 abhijeetk88 changed the title Kafka-15625: Integrate RLMQuotaManager for throttling copies to remote storage Kafka-15265: Integrate RLMQuotaManager for throttling copies to remote storage May 24, 2024
@abhijeetk88 abhijeetk88 changed the title Kafka-15265: Integrate RLMQuotaManager for throttling copies to remote storage KAFKA-15265: Integrate RLMQuotaManager for throttling copies to remote storage May 24, 2024
@abhijeetk88 abhijeetk88 force-pushed the KAFKA-15434_copy_quota branch 3 times, most recently from b56b448 to 22a7ae5 Compare May 26, 2024 12:59
@satishd satishd added the tiered-storage Related to the Tiered Storage feature label May 27, 2024
Copy link
Copy Markdown
Member

@showuon showuon left a comment

Choose a reason for hiding this comment

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

Had an early review, left some comments. Will check again after #15625 merged. Thanks.

Comment thread core/src/test/java/kafka/log/remote/RemoteLogManagerTest.java Outdated
Comment thread core/src/test/java/kafka/log/remote/RemoteLogManagerTest.java Outdated
Comment thread core/src/main/java/kafka/log/remote/RemoteLogManager.java
Comment thread core/src/main/java/kafka/log/remote/RemoteLogManager.java
@abhijeetk88 abhijeetk88 force-pushed the KAFKA-15434_copy_quota branch 2 times, most recently from 52c34f6 to aa32909 Compare May 30, 2024 18:34
@satishd
Copy link
Copy Markdown
Member

satishd commented May 31, 2024

@abhijeetk88 Can you resolve the conflicts?

@abhijeetk88 abhijeetk88 force-pushed the KAFKA-15434_copy_quota branch from aa32909 to 68412eb Compare May 31, 2024 04:06
Copy link
Copy Markdown
Member

@showuon showuon left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks.

Comment thread core/src/test/java/kafka/log/remote/RemoteLogManagerTest.java Outdated
Comment thread core/src/main/java/kafka/log/remote/RemoteLogManager.java Outdated
Comment thread core/src/test/java/kafka/log/remote/RemoteLogManagerTest.java Outdated
Comment thread core/src/test/java/kafka/log/remote/RemoteLogManagerTest.java Outdated
Comment thread core/src/test/java/kafka/log/remote/RemoteLogManagerTest.java Outdated
Copy link
Copy Markdown
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 @abhijeetk88 for the PR, overall LGTM. Left a minor comment and +1 on the comment regarding the refactoring of the simpler test condition.

* Returns the timeout for the RLM Tasks to wait for the quota to be available
*/
Duration quotaTimeout() {
return Duration.ofSeconds(1);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you use the declared constant value?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I want to override this method to have a smaller timeout for tests. That is the reason I did not use a constant value.

@abhijeetk88 abhijeetk88 force-pushed the KAFKA-15434_copy_quota branch from 68412eb to 5440667 Compare June 3, 2024 08:58
Copy link
Copy Markdown
Contributor

@kamalcph kamalcph left a comment

Choose a reason for hiding this comment

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

Thanks for the update! Left one comment to address.

// If the thread gets interrupted while waiting, the InterruptedException is thrown
// back to the caller. It's important to note that the task being executed is already
// cancelled before the executing thread is interrupted. The caller is responsible
// for handling the exception gracefully by checking if the task is already cancelled.
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.

Could you cover shutdown when the quota gets breached as unit test?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will add.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

@showuon
Copy link
Copy Markdown
Member

showuon commented Jun 6, 2024

@abhijeetk88 , any update to this PR?

@abhijeetk88
Copy link
Copy Markdown
Contributor Author

Hi @showuon. I have responded to your comment here. Please take a look.

@abhijeetk88 abhijeetk88 force-pushed the KAFKA-15434_copy_quota branch from 5440667 to 5c1ef3c Compare June 8, 2024 22:35
@abhijeetk88
Copy link
Copy Markdown
Contributor Author

@kamalcph I have addressed your comments, please take a look.

Copy link
Copy Markdown
Contributor

@kamalcph kamalcph left a comment

Choose a reason for hiding this comment

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

Overall LGTM, left one comment to address!

Comment thread core/src/test/java/kafka/log/remote/RemoteLogManagerTest.java Outdated
@abhijeetk88 abhijeetk88 force-pushed the KAFKA-15434_copy_quota branch from 154ae9a to 22016f2 Compare June 10, 2024 10:53
Copy link
Copy Markdown
Contributor

@kamalcph kamalcph left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for patch!

@satishd
Copy link
Copy Markdown
Member

satishd commented Jun 12, 2024

Thanks @abhijeetk88 for addressing the review comments. LGTM.

@satishd
Copy link
Copy Markdown
Member

satishd commented Jun 12, 2024

There are a few unrelated test failures, merging it to trunk and 3.8.

@satishd satishd merged commit 23fe71d into apache:trunk Jun 12, 2024
satishd pushed a commit that referenced this pull request Jun 12, 2024
…e storage (#15820)

- Added the integration of the quota manager to throttle copy requests to the remote storage. Reference KIP-956
- Added unit-tests for the copy throttling logic.

Reviewers: Satish Duggana <satishd@apache.org>, Luke Chen <showuon@gmail.com>, Kamal Chandraprakash<kamal.chandraprakash@gmail.com>
gongxuanzhang pushed a commit to gongxuanzhang/kafka that referenced this pull request Jun 12, 2024
…e storage (apache#15820)

- Added the integration of the quota manager to throttle copy requests to the remote storage. Reference KIP-956
- Added unit-tests for the copy throttling logic.

Reviewers: Satish Duggana <satishd@apache.org>, Luke Chen <showuon@gmail.com>, Kamal Chandraprakash<kamal.chandraprakash@gmail.com>
apourchet added a commit to apourchet/kafka that referenced this pull request Jun 12, 2024
commit 9368ef8
Author: Gantigmaa Selenge <39860586+tinaselenge@users.noreply.github.com>
Date:   Wed Jun 12 16:04:24 2024 +0100

    KAFKA-16865: Add IncludeTopicAuthorizedOperations option for DescribeTopicPartitionsRequest (apache#16136)

    Reviewers: Mickael Maison <mickael.maison@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>, Calvin Liu <caliu@confluent.io>, Andrew Schofield <andrew_schofield@live.com>, Apoorv Mittal <amittal@confluent.io>

commit 46eb081
Author: gongxuanzhang <gongxuanzhang@foxmail.com>
Date:   Wed Jun 12 22:23:39 2024 +0800

    KAFKA-10787 Apply spotless to log4j-appender, trogdor, jmh-benchmarks, examples, shell and generator (apache#16296)

    Reviewers: Chia-Ping Tsai <chia7712@gmail.com>

commit 79b9c44
Author: gongxuanzhang <gongxuanzhang@foxmail.com>
Date:   Wed Jun 12 22:19:47 2024 +0800

    KAFKA-10787 Apply spotless to connect module (apache#16299)

    Reviewers: Chia-Ping Tsai <chia7712@gmail.com>

commit b5fb654
Author: Abhijeet Kumar <abhijeet.cse.kgp@gmail.com>
Date:   Wed Jun 12 19:47:46 2024 +0530

    KAFKA-15265: Dynamic broker configs for remote fetch/copy quotas (apache#16078)

    Reviewers: Kamal Chandraprakash<kamal.chandraprakash@gmail.com>, Satish Duggana <satishd@apache.org>

commit faee6a4
Author: Dmitry Werner <grimekillah@gmail.com>
Date:   Wed Jun 12 15:44:11 2024 +0500

    MINOR: Use predetermined dir IDs in ReplicationQuotasTest

    Use predetermined directory IDs instead of Uuid.randomUuid() in ReplicationQuotasTest.

    Reviewers: Igor Soarez <soarez@apple.com>

commit 638844f
Author: David Jacot <djacot@confluent.io>
Date:   Wed Jun 12 08:29:50 2024 +0200

    KAFKA-16770; [2/2] Coalesce records into bigger batches (apache#16215)

    This patch is the continuation of apache#15964. It introduces the records coalescing to the CoordinatorRuntime. It also introduces a new configuration `group.coordinator.append.linger.ms` which allows administrators to chose the linger time or disable it with zero. The new configuration defaults to 10ms.

    Reviewers: Jeff Kim <jeff.kim@confluent.io>, Justine Olshan <jolshan@confluent.io>

commit 39ffdea
Author: Bruno Cadonna <cadonna@apache.org>
Date:   Wed Jun 12 07:51:38 2024 +0200

    KAFKA-10199: Enable state updater by default (apache#16107)

    We have already enabled the state updater by default once.
    However, we ran into issues that forced us to disable it again.
    We think that we fixed those issues. So we want to enable the
    state updater again by default.

    Reviewers: Lucas Brutschy <lbrutschy@confluent.io>, Matthias J. Sax <matthias@confluent.io>

commit 0782232
Author: Antoine Pourchet <antoine@responsive.dev>
Date:   Tue Jun 11 22:31:43 2024 -0600

    KAFKA-15045: (KIP-924 pt. 22) Add RackAwareOptimizationParams and other minor TaskAssignmentUtils changes (apache#16294)

    We now provide a way to more easily customize the rack aware
    optimizations that we provide by way of a configuration class called
    RackAwareOptimizationParams.

    We also simplified the APIs for the optimizeXYZ utility functions since
    they were mutating the inputs anyway.

    Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>

commit 226ac5e
Author: Murali Basani <muralidhar.basani@aiven.io>
Date:   Wed Jun 12 05:38:50 2024 +0200

    KAFKA-16922 Adding unit tests for NewTopic  (apache#16255)

    Reviewers: Chia-Ping Tsai <chia7712@gmail.com>

commit 23fe71d
Author: Abhijeet Kumar <abhijeet.cse.kgp@gmail.com>
Date:   Wed Jun 12 06:27:02 2024 +0530

    KAFKA-15265: Integrate RLMQuotaManager for throttling copies to remote storage (apache#15820)

    - Added the integration of the quota manager to throttle copy requests to the remote storage. Reference KIP-956
    - Added unit-tests for the copy throttling logic.

    Reviewers: Satish Duggana <satishd@apache.org>, Luke Chen <showuon@gmail.com>, Kamal Chandraprakash<kamal.chandraprakash@gmail.com>

commit 2fa2c72
Author: Chris Egerton <chrise@aiven.io>
Date:   Tue Jun 11 23:15:07 2024 +0200

    MINOR: Wait for embedded clusters to start before using them in Connect OffsetsApiIntegrationTest (apache#16286)

    Reviewers: Greg Harris <greg.harris@aiven.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tiered-storage Related to the Tiered Storage feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants