You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "FrankYang0529 (via GitHub)" <gi...@apache.org> on 2025/01/14 09:34:23 UTC
[PR] KAFAK-18451: Flaky RemoteLogManagerTest#testRLMOpsWhenMetadataIsNotReady [kafka]
FrankYang0529 opened a new pull request, #18520:
URL: https://github.com/apache/kafka/pull/18520
The `REMOTE_LOG_MANAGER_TASK_INTERVAL_MS_PROP` in `RemoteLogManagerTest` is 100 which is too small. It assertions `verifyNoMoreInteractions` can't run in 100ms, the scheduler will run `RLMTask` again and the case will fail.
### Committer Checklist (excluded from commit message)
- [ ] Verify design and implementation
- [ ] Verify test coverage and CI build status
- [ ] Verify documentation (including upgrade notes)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFAK-18451: Flaky RemoteLogManagerTest#testRLMOpsWhenMetadataIsNotReady [kafka]
Posted by "FrankYang0529 (via GitHub)" <gi...@apache.org>.
FrankYang0529 commented on PR #18520:
URL: https://github.com/apache/kafka/pull/18520#issuecomment-2591860352
Hi @showuon, thanks for trigger CI again. There are some flaky test cases which are not related to this PR. I can't reproduce on my laptop as well.
* PlaintextConsumerPollTest#testMaxPollIntervalMsDelayInRevocation: https://issues.apache.org/jira/browse/KAFKA-18535
* AbstractCoordinatorTest#testWakeupAfterSyncGroupReceivedExternalCompletion: https://issues.apache.org/jira/browse/KAFKA-18310
* TransactionsWithTieredStoreTest#testBumpTransactionalEpochWithTV2Disabled: https://issues.apache.org/jira/browse/KAFKA-18035
* ReplicationQuotasTest#shouldBootstrapTwoBrokersWithFollowerThrottle: https://issues.apache.org/jira/browse/KAFKA-18536
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFAK-18451: Flaky RemoteLogManagerTest#testRLMOpsWhenMetadataIsNotReady [kafka]
Posted by "showuon (via GitHub)" <gi...@apache.org>.
showuon merged PR #18520:
URL: https://github.com/apache/kafka/pull/18520
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFAK-18451: Flaky RemoteLogManagerTest#testRLMOpsWhenMetadataIsNotReady [kafka]
Posted by "FrankYang0529 (via GitHub)" <gi...@apache.org>.
FrankYang0529 commented on code in PR #18520:
URL: https://github.com/apache/kafka/pull/18520#discussion_r1914536078
##########
core/src/test/java/kafka/log/remote/RemoteLogManagerTest.java:
##########
@@ -3682,8 +3682,42 @@ int lookupPositionForOffset(RemoteLogSegmentMetadata remoteLogSegmentMetadata, l
}
@Test
- public void testRLMOpsWhenMetadataIsNotReady() throws InterruptedException {
- CountDownLatch latch = new CountDownLatch(2);
+ public void testRLMOpsWhenMetadataIsNotReady() throws InterruptedException, IOException {
+ // Recreate a remoteLogManager with default REMOTE_LOG_MANAGER_TASK_INTERVAL_MS_PROP (default value is 30000).
+ // The value in setup function is 100 which is too small. If the case can't run two verifyNoMoreInteractions in
+ // 100ms, the test will fail.
+ remoteLogManager.close();
+ clearInvocations(remoteLogMetadataManager, remoteStorageManager);
+ Properties props = brokerConfig;
+ props.setProperty(RemoteLogManagerConfig.REMOTE_LOG_STORAGE_SYSTEM_ENABLE_PROP, "true");
+ props.setProperty(RemoteLogManagerConfig.REMOTE_LOG_MANAGER_TASK_INTERVAL_MS_PROP, "30000");
+ appendRLMConfig(props);
+ config = KafkaConfig.fromProps(props);
+
+ remoteLogManager = new RemoteLogManager(config.remoteLogManagerConfig(), brokerId, logDir, clusterId, time,
+ tp -> Optional.of(mockLog),
+ (topicPartition, offset) -> currentLogStartOffset.set(offset),
+ brokerTopicStats, metrics) {
+ public RemoteStorageManager createRemoteStorageManager() {
+ return remoteStorageManager;
+ }
+ public RemoteLogMetadataManager createRemoteLogMetadataManager() {
+ return remoteLogMetadataManager;
+ }
+ public RLMQuotaManager createRLMCopyQuotaManager() {
+ return rlmCopyQuotaManager;
+ }
+ public Duration quotaTimeout() {
+ return Duration.ofMillis(100);
+ }
+ @Override
+ long findLogStartOffset(TopicIdPartition topicIdPartition, UnifiedLog log) {
+ return 0L;
+ }
+ };
+ doReturn(true).when(remoteLogMetadataManager).isReady(any(TopicIdPartition.class));
+
+ CountDownLatch latch = new CountDownLatch(3); // there are 3 RLMTasks, so setting the count to 3
when(remoteLogMetadataManager.isReady(any(TopicIdPartition.class)))
Review Comment:
Yes, I just copied and pasted `setup` function and didn't notice that. Thanks for catching it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFAK-18451: Flaky RemoteLogManagerTest#testRLMOpsWhenMetadataIsNotReady [kafka]
Posted by "showuon (via GitHub)" <gi...@apache.org>.
showuon commented on code in PR #18520:
URL: https://github.com/apache/kafka/pull/18520#discussion_r1914531713
##########
core/src/test/java/kafka/log/remote/RemoteLogManagerTest.java:
##########
@@ -3682,8 +3682,42 @@ int lookupPositionForOffset(RemoteLogSegmentMetadata remoteLogSegmentMetadata, l
}
@Test
- public void testRLMOpsWhenMetadataIsNotReady() throws InterruptedException {
- CountDownLatch latch = new CountDownLatch(2);
+ public void testRLMOpsWhenMetadataIsNotReady() throws InterruptedException, IOException {
+ // Recreate a remoteLogManager with default REMOTE_LOG_MANAGER_TASK_INTERVAL_MS_PROP (default value is 30000).
+ // The value in setup function is 100 which is too small. If the case can't run two verifyNoMoreInteractions in
+ // 100ms, the test will fail.
+ remoteLogManager.close();
+ clearInvocations(remoteLogMetadataManager, remoteStorageManager);
+ Properties props = brokerConfig;
+ props.setProperty(RemoteLogManagerConfig.REMOTE_LOG_STORAGE_SYSTEM_ENABLE_PROP, "true");
+ props.setProperty(RemoteLogManagerConfig.REMOTE_LOG_MANAGER_TASK_INTERVAL_MS_PROP, "30000");
+ appendRLMConfig(props);
+ config = KafkaConfig.fromProps(props);
+
+ remoteLogManager = new RemoteLogManager(config.remoteLogManagerConfig(), brokerId, logDir, clusterId, time,
+ tp -> Optional.of(mockLog),
+ (topicPartition, offset) -> currentLogStartOffset.set(offset),
+ brokerTopicStats, metrics) {
+ public RemoteStorageManager createRemoteStorageManager() {
+ return remoteStorageManager;
+ }
+ public RemoteLogMetadataManager createRemoteLogMetadataManager() {
+ return remoteLogMetadataManager;
+ }
+ public RLMQuotaManager createRLMCopyQuotaManager() {
+ return rlmCopyQuotaManager;
+ }
+ public Duration quotaTimeout() {
+ return Duration.ofMillis(100);
+ }
+ @Override
+ long findLogStartOffset(TopicIdPartition topicIdPartition, UnifiedLog log) {
+ return 0L;
+ }
+ };
+ doReturn(true).when(remoteLogMetadataManager).isReady(any(TopicIdPartition.class));
+
+ CountDownLatch latch = new CountDownLatch(3); // there are 3 RLMTasks, so setting the count to 3
when(remoteLogMetadataManager.isReady(any(TopicIdPartition.class)))
Review Comment:
I think L3718 is not needed because we want to use the mock in L3721, right?
##########
core/src/test/java/kafka/log/remote/RemoteLogManagerTest.java:
##########
@@ -3682,8 +3682,42 @@ int lookupPositionForOffset(RemoteLogSegmentMetadata remoteLogSegmentMetadata, l
}
@Test
- public void testRLMOpsWhenMetadataIsNotReady() throws InterruptedException {
- CountDownLatch latch = new CountDownLatch(2);
+ public void testRLMOpsWhenMetadataIsNotReady() throws InterruptedException, IOException {
+ // Recreate a remoteLogManager with default REMOTE_LOG_MANAGER_TASK_INTERVAL_MS_PROP (default value is 30000).
+ // The value in setup function is 100 which is too small. If the case can't run two verifyNoMoreInteractions in
+ // 100ms, the test will fail.
+ remoteLogManager.close();
+ clearInvocations(remoteLogMetadataManager, remoteStorageManager);
+ Properties props = brokerConfig;
+ props.setProperty(RemoteLogManagerConfig.REMOTE_LOG_STORAGE_SYSTEM_ENABLE_PROP, "true");
+ props.setProperty(RemoteLogManagerConfig.REMOTE_LOG_MANAGER_TASK_INTERVAL_MS_PROP, "30000");
+ appendRLMConfig(props);
+ config = KafkaConfig.fromProps(props);
+
+ remoteLogManager = new RemoteLogManager(config.remoteLogManagerConfig(), brokerId, logDir, clusterId, time,
+ tp -> Optional.of(mockLog),
+ (topicPartition, offset) -> currentLogStartOffset.set(offset),
+ brokerTopicStats, metrics) {
+ public RemoteStorageManager createRemoteStorageManager() {
+ return remoteStorageManager;
+ }
+ public RemoteLogMetadataManager createRemoteLogMetadataManager() {
+ return remoteLogMetadataManager;
+ }
+ public RLMQuotaManager createRLMCopyQuotaManager() {
+ return rlmCopyQuotaManager;
+ }
+ public Duration quotaTimeout() {
+ return Duration.ofMillis(100);
+ }
+ @Override
+ long findLogStartOffset(TopicIdPartition topicIdPartition, UnifiedLog log) {
+ return 0L;
+ }
+ };
+ doReturn(true).when(remoteLogMetadataManager).isReady(any(TopicIdPartition.class));
+
+ CountDownLatch latch = new CountDownLatch(3); // there are 3 RLMTasks, so setting the count to 3
Review Comment:
Nice catch!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFAK-18451: Flaky RemoteLogManagerTest#testRLMOpsWhenMetadataIsNotReady [kafka]
Posted by "showuon (via GitHub)" <gi...@apache.org>.
showuon commented on PR #18520:
URL: https://github.com/apache/kafka/pull/18520#issuecomment-2591470261
Re-running CI.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org