Skip to content

Conversation

TaiJuWu
Copy link
Collaborator

@TaiJuWu TaiJuWu commented Mar 25, 2025

  1. Remove RemoteLogManager#startup and
    RemoteLogManager#onEndpointCreated
  2. Move endpoint creation to BrokerServer
  3. Move RemoteLogMetadataManager#configure and
    RemoteLogStorageManager#configure to RemoteLogManager constructor

Reviewers: Mickael Maison [email protected], Ken Huang
[email protected], Jhen-Yung Hsu [email protected]

@github-actions github-actions bot added triage PRs from the community core Kafka Broker tiered-storage Related to the Tiered Storage feature small Small PRs labels Mar 25, 2025
@TaiJuWu TaiJuWu changed the title (WIP) KAFKA-18891: Add support for RemoteLogMetadataManager and RemoteStorageManager (WIP) KAFKA-18891: KIP-877 add support for RemoteLogMetadataManager and RemoteStorageManager Mar 26, 2025
@github-actions github-actions bot added clients and removed small Small PRs labels Mar 26, 2025
@TaiJuWu TaiJuWu changed the title (WIP) KAFKA-18891: KIP-877 add support for RemoteLogMetadataManager and RemoteStorageManager KAFKA-18891: KIP-877 add support for RemoteLogMetadataManager and RemoteStorageManager Mar 26, 2025
@TaiJuWu TaiJuWu changed the title KAFKA-18891: KIP-877 add support for RemoteLogMetadataManager and RemoteStorageManager (WIP) KAFKA-18891: KIP-877 add support for RemoteLogMetadataManager and RemoteStorageManager Mar 26, 2025
@TaiJuWu TaiJuWu changed the title (WIP) KAFKA-18891: KIP-877 add support for RemoteLogMetadataManager and RemoteStorageManager KAFKA-18891: KIP-877 add support for RemoteLogMetadataManager and RemoteStorageManager Mar 26, 2025
@TaiJuWu TaiJuWu requested a review from mimaison March 26, 2025 09:50
Copy link
Member

@mimaison mimaison 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 PR. It's really not nice that we need to build the plugin in 2 stages. I left a suggestion to refactor the RemoteLogManager creation logic. Let's see what people think

@github-actions github-actions bot removed the triage PRs from the community label Mar 27, 2025
@TaiJuWu
Copy link
Collaborator Author

TaiJuWu commented Apr 3, 2025

Thanks for the PR! Can we also add an integration test? For example something like I'm doing in https://github.com/apache/kafka/pull/19050/files#diff-6ecc777f37395e25591a118f0eef88d602c765a66adace6247f98cf4ea159bc9

I will take a look later.

@github-actions github-actions bot added the build Gradle build or GitHub Actions label Apr 10, 2025
@TaiJuWu TaiJuWu changed the title KAFKA-18891: KIP-877 add support for RemoteLogMetadataManager and RemoteStorageManager (WIP) KAFKA-18891: KIP-877 add support for RemoteLogMetadataManager and RemoteStorageManager Apr 10, 2025
@TaiJuWu TaiJuWu changed the title (WIP) KAFKA-18891: KIP-877 add support for RemoteLogMetadataManager and RemoteStorageManager KAFKA-18891: KIP-877 add support for RemoteLogMetadataManager and RemoteStorageManager Apr 10, 2025
@TaiJuWu TaiJuWu changed the title KAFKA-18891: KIP-877 add support for RemoteLogMetadataManager and RemoteStorageManager (WIP) KAFKA-18891: KIP-877 add support for RemoteLogMetadataManager and RemoteStorageManager Apr 10, 2025
@TaiJuWu TaiJuWu changed the title (WIP) KAFKA-18891: KIP-877 add support for RemoteLogMetadataManager and RemoteStorageManager KAFKA-18891: KIP-877 add support for RemoteLogMetadataManager and RemoteStorageManager Apr 10, 2025
@TaiJuWu
Copy link
Collaborator Author

TaiJuWu commented Apr 10, 2025

Thanks for the PR! Can we also add an integration test? For example something like I'm doing in https://github.com/apache/kafka/pull/19050/files#diff-6ecc777f37395e25591a118f0eef88d602c765a66adace6247f98cf4ea159bc9

I have updated integration test, PTAL.

Copy link
Member

@mimaison mimaison 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 updates, I made another pass and left a few more comments


remoteStorageManagerPlugin = configAndWrapRSMPlugin(createRemoteStorageManager());
remoteLogMetadataManagerPlugin = configAndWrapRLMMPlugin(createRemoteLogMetadataManager());
remoteLogManagerConfigured = true;
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to keep this field? It's always set to true in the constructor, so it can never be null if you have an instance of RemoteLogManager

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Remove it.

@@ -237,9 +239,12 @@ public RemoteLogManager(RemoteLogManagerConfig rlmConfig,
this.updateRemoteLogStartOffset = updateRemoteLogStartOffset;
this.brokerTopicStats = brokerTopicStats;
this.metrics = metrics;
this.endpoint = endpoint;

remoteStorageManagerPlugin = configAndWrapRSMPlugin(createRemoteStorageManager());
Copy link
Member

Choose a reason for hiding this comment

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

Could we merge the create and config methods? For example have createRemoteStorageManagerPlugin() do it all and return Plugin<RemoteStorageManager>.

Same for remoteLogMetadataManagerPlugin

Copy link
Collaborator Author

@TaiJuWu TaiJuWu Apr 15, 2025

Choose a reason for hiding this comment

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

The reason I did not merge this two methods was if we merge them into one, we will include the configuration step when creating RLMM and RSM in test (we use createRemoteStorageManager in test).

That means we will miss real configuration step in test if merge them (configuration step should be included in createRemoteStorageManagerPlugin)

Comment on lines 3762 to 3763
assertEquals(true, ((MonitorableNoOpRemoteStorageManager) remoteLogManager.storageManager()).pluginMetrics);
assertEquals(true, ((MonitorableNoOpRemoteLogMetadataManager) remoteLogManager.remoteLogMetadataManager()).pluginMetrics);
Copy link
Member

Choose a reason for hiding this comment

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

We can use assertTrue()

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

return tags;
}

}
Copy link
Member

Choose a reason for hiding this comment

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

nit: missing new line

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

}
}

private static Map<String, String> expectedTags(String config, String clazz) {
Copy link
Member

Choose a reason for hiding this comment

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

Do we really need this method?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Remove it, thanks.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

After merging trunk and move private method to the end, this method is back.

@mimaison
Copy link
Member

Can you rebase on trunk?

@TaiJuWu
Copy link
Collaborator Author

TaiJuWu commented Apr 17, 2025

Can you rebase on trunk?

Update, thanks.

Copy link
Member

@mimaison mimaison left a comment

Choose a reason for hiding this comment

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

LGTM

@mimaison mimaison merged commit 6e4e0df into apache:trunk Apr 18, 2025
23 checks passed
@TaiJuWu TaiJuWu deleted the 877_log branch April 18, 2025 13:10
rreddy-22 pushed a commit to rreddy-22/kafka-rreddy that referenced this pull request Apr 21, 2025
…teStorageManager (apache#19286)

1. Remove `RemoteLogManager#startup` and
`RemoteLogManager#onEndpointCreated`
2. Move endpoint creation to `BrokerServer`
3. Move `RemoteLogMetadataManager#configure` and
`RemoteLogStorageManager#configure` to RemoteLogManager constructor

Reviewers: Mickael Maison <[email protected]>, Ken Huang
 <[email protected]>, Jhen-Yung Hsu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Gradle build or GitHub Actions clients core Kafka Broker 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.

4 participants