Skip to content
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

KAFKA-15037: pass remoteLogEnabled to unifiedLog #13779

Merged
merged 3 commits into from Jun 5, 2023

Conversation

showuon
Copy link
Contributor

@showuon showuon commented May 30, 2023

UnifiedLog relied on the remoteStorageSystemEnable to identify if the broker is enabling remote storage, but we never pass this value from the config into UnifiedLog. So it'll always be false.

In this PR, I did:

  1. pass remoteStorageSystemEnable to UnifiedLog
  2. remove remoteLogManager from the class member of UnifiedLog since only UnifiedLog#fetchOffsetByTimestamp needs remoteLogManager, and this can be passed when called from ReplicaManager.

Committer Checklist (excluded from commit message)

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

@@ -159,7 +159,7 @@ public void run() {
while (!closing) {
maybeWaitForPartitionsAssignment();

log.info("Polling consumer to receive remote log metadata topic records");
log.trace("Polling consumer to receive remote log metadata topic records");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Logging this line on each consumer poll will flood the log. Change to trace level

@showuon
Copy link
Contributor Author

showuon commented May 30, 2023

@satishd , please take a look. Thanks.

@divijvaidya
Copy link
Contributor

For point 2, I think @satishd has some refactoring in mind to add more logic to UnifiedLog as per #13561 (comment)

all this logic will go to UnifiedLog in future.

Perhaps, we can perform all the refactoring in one go together later on prior to 3.6 release.

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 @showuon for the PR, left a minor comment.

These two minor changes were missed porting from 2.8.x branch. It is good to have them in the trunk.

@@ -1398,7 +1402,8 @@ object LogManager {
logDirFailureChannel = logDirFailureChannel,
time = time,
keepPartitionMetadataFile = keepPartitionMetadataFile,
interBrokerProtocolVersion = config.interBrokerProtocolVersion)
interBrokerProtocolVersion = config.interBrokerProtocolVersion,
remoteStorageSystemEnable = config.getBoolean(RemoteLogManagerConfig.REMOTE_LOG_STORAGE_SYSTEM_ENABLE_PROP))
Copy link
Member

Choose a reason for hiding this comment

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

Use config.remoteLogManagerConfig.enableRemoteStorageSystem() instead of checking the specific property in config as it is already built.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it's better to use onfig.remoteLogManagerConfig.enableRemoteStorageSystem(). Updated.

@satishd
Copy link
Member

satishd commented May 31, 2023

For point 2, I think @satishd has some refactoring in mind to add more logic to UnifiedLog as per #13561 (comment)

all this logic will go to UnifiedLog in future.

Perhaps, we can perform all the refactoring in one go together later on prior to 3.6 release.

+1 to have (2) for now. It does not need to wait for other refactorings.

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.

@showuon There are test failures in UnifiedLogTest.testFetchOffsetByTimestampFromRemoteStorage as remoteLogManager is not passed as an argument.

@showuon
Copy link
Contributor Author

showuon commented May 31, 2023

@showuon There are test failures in UnifiedLogTest.testFetchOffsetByTimestampFromRemoteStorage as remoteLogManager is not passed as an argument.

Sorry, I should have checked the build status. Fixed now. 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 @showuon for addressing the review comments. LGTM.

Copy link
Collaborator

@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

@showuon
Copy link
Contributor Author

showuon commented Jun 5, 2023

Failed tests are unrelated (with one infra's issue):

    Build / JDK 17 and Scala 2.13 / org.apache.kafka.connect.runtime.isolation.DelegatingClassLoaderTest.testLoadingMixOfValidAndInvalidPlugins
    Build / JDK 17 and Scala 2.13 / org.apache.kafka.controller.QuorumControllerTest.testFenceMultipleBrokers()
    Build / JDK 11 and Scala 2.13 / org.apache.kafka.connect.mirror.integration.IdentityReplicationIntegrationTest.testRestartReplication()
    Build / JDK 11 and Scala 2.13 / org.apache.kafka.connect.mirror.integration.MirrorConnectorsIntegrationExactlyOnceTest.testReplication()
    Build / JDK 11 and Scala 2.13 / kafka.admin.DeleteTopicTest.executionError
    Build / JDK 11 and Scala 2.13 / kafka.admin.LeaderElectionCommandTest.[1] Type=Raft-Isolated, Name=testAllTopicPartition, MetadataVersion=3.5-IV2, Security=PLAINTEXT
    Build / JDK 11 and Scala 2.13 / kafka.admin.LeaderElectionCommandTest.[2] Type=Raft-Combined, Name=testAllTopicPartition, MetadataVersion=3.5-IV2, Security=PLAINTEXT
    Build / JDK 11 and Scala 2.13 / kafka.admin.LeaderElectionCommandTest.[3] Type=ZK, Name=testAllTopicPartition, MetadataVersion=3.5-IV2, Security=PLAINTEXT
    Build / JDK 11 and Scala 2.13 / kafka.admin.LeaderElectionCommandTest.[1] Type=Raft-Isolated, Name=testPathToJsonFile, MetadataVersion=3.5-IV2, Security=PLAINTEXT
    Build / JDK 11 and Scala 2.13 / kafka.admin.LeaderElectionCommandTest.[2] Type=Raft-Combined, Name=testPathToJsonFile, MetadataVersion=3.5-IV2, Security=PLAINTEXT
    Build / JDK 11 and Scala 2.13 / kafka.admin.LeaderElectionCommandTest.[3] Type=ZK, Name=testPathToJsonFile, MetadataVersion=3.5-IV2, Security=PLAINTEXT
    Build / JDK 11 and Scala 2.13 / kafka.admin.LeaderElectionCommandTest.[1] Type=Raft-Isolated, Name=testTopicDoesNotExist, MetadataVersion=3.5-IV2, Security=PLAINTEXT
    Build / JDK 11 and Scala 2.13 / kafka.admin.LeaderElectionCommandTest.[2] Type=Raft-Combined, Name=testTopicDoesNotExist, MetadataVersion=3.5-IV2, Security=PLAINTEXT
    Build / JDK 11 and Scala 2.13 / kafka.admin.LeaderElectionCommandTest.[3] Type=ZK, Name=testTopicDoesNotExist, MetadataVersion=3.5-IV2, Security=PLAINTEXT
    Build / JDK 11 and Scala 2.13 / kafka.admin.LeaderElectionCommandTest.[1] Type=Raft-Isolated, Name=testPreferredReplicaElection, MetadataVersion=3.5-IV2, Security=PLAINTEXT
    Build / JDK 11 and Scala 2.13 / kafka.admin.LeaderElectionCommandTest.[2] Type=Raft-Combined, Name=testPreferredReplicaElection, MetadataVersion=3.5-IV2, Security=PLAINTEXT
    Build / JDK 11 and Scala 2.13 / kafka.admin.LeaderElectionCommandTest.[3] Type=ZK, Name=testPreferredReplicaElection, MetadataVersion=3.5-IV2, Security=PLAINTEXT
    Build / JDK 11 and Scala 2.13 / kafka.admin.LeaderElectionCommandTest.[1] Type=Raft-Isolated, Name=testElectionResultOutput, MetadataVersion=3.5-IV2, Security=PLAINTEXT
    Build / JDK 11 and Scala 2.13 / kafka.admin.LeaderElectionCommandTest.[2] Type=Raft-Combined, Name=testElectionResultOutput, MetadataVersion=3.5-IV2, Security=PLAINTEXT
    Build / JDK 11 and Scala 2.13 / kafka.admin.LeaderElectionCommandTest.[3] Type=ZK, Name=testElectionResultOutput, MetadataVersion=3.5-IV2, Security=PLAINTEXT
    Build / JDK 11 and Scala 2.13 / kafka.admin.LeaderElectionCommandTest.[1] Type=Raft-Isolated, Name=testTopicPartition, MetadataVersion=3.5-IV2, Security=PLAINTEXT
    Build / JDK 11 and Scala 2.13 / kafka.admin.LeaderElectionCommandTest.[2] Type=Raft-Combined, Name=testTopicPartition, MetadataVersion=3.5-IV2, Security=PLAINTEXT
    Build / JDK 11 and Scala 2.13 / kafka.admin.LeaderElectionCommandTest.[3] Type=ZK, Name=testTopicPartition, MetadataVersion=3.5-IV2, Security=PLAINTEXT
    Build / JDK 11 and Scala 2.13 / kafka.admin.ListOffsetsIntegrationTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.admin.ReassignPartitionsIntegrationTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.admin.ResetConsumerGroupOffsetTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.api.AdminClientWithPoliciesIntegrationTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.api.ClientIdQuotaTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.api.ConsumerBounceTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.api.ConsumerWithLegacyMessageFormatIntegrationTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.api.DelegationTokenEndToEndAuthorizationTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.api.EndToEndClusterIdTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.api.GroupCoordinatorIntegrationTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.api.LogAppendTimeTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.api.PlaintextConsumerTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.api.PlaintextEndToEndAuthorizationTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.api.ProducerFailureHandlingTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.api.ProducerSendWhileDeletionTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.api.SaslClientsWithInvalidCredentialsTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.api.SaslGssapiSslEndToEndAuthorizationTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.api.SaslOAuthBearerSslEndToEndAuthorizationTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.api.SaslPlaintextConsumerTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.api.SaslSslConsumerTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.api.SslConsumerTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.api.SslProducerSendTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.api.TransactionsBounceTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.api.TransactionsTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.api.UserClientIdQuotaTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.api.test.ProducerCompressionTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.integration.MinIsrConfigTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.network.DynamicConnectionQuotaTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.security.authorizer.AclAuthorizerWithZkSaslTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.server.AdvertiseBrokerTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.server.AlterReplicaLogDirsRequestTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.server.AlterUserScramCredentialsRequestTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.server.ControllerMutationQuotaTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.server.CreateTopicsRequestWithPolicyTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.server.DelegationTokenRequestsOnPlainTextTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.server.DelegationTokenRequestsWithDisableTokenFeatureTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.server.DeleteTopicsRequestTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.server.DescribeClusterRequestTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.server.DescribeLogDirsRequestTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.server.DescribeUserScramCredentialsRequestNotAuthorizedTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.server.DynamicBrokerReconfigurationTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.server.EdgeCaseRequestTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.server.FetchRequestDownConversionConfigTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.server.FetchRequestTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.server.FetchRequestWithLegacyMessageFormatTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.server.FinalizedFeatureChangeListenerTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.server.GssapiAuthenticationTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.server.KafkaMetricReporterClusterIdTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.server.KafkaMetricReporterExceptionHandlingTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.server.KafkaMetricsReporterTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.server.KafkaServerTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.server.ListOffsetsRequestTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.server.LogDirFailureTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.server.LogRecoveryTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.server.MetadataRequestTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.server.MultipleListenersWithAdditionalJaasContextTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.server.OffsetFetchRequestTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.server.ServerGenerateClusterIdTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.server.ServerShutdownTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.server.UpdateFeaturesTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.server.epoch.EpochDrivenReplicationProtocolAcceptanceWithIbp26Test.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.zk.KafkaZkClientTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.zk.migration.ZkAclMigrationClientTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.zk.migration.ZkMigrationClientTest.initializationError
    Build / JDK 11 and Scala 2.13 / kafka.zookeeper.ZooKeeperClientTest.initializationError
    Build / JDK 8 and Scala 2.12 / org.apache.kafka.connect.mirror.integration.DedicatedMirrorIntegrationTest.testMultiNodeCluster()
    Build / JDK 8 and Scala 2.12 / org.apache.kafka.connect.mirror.integration.DedicatedMirrorIntegrationTest.testMultiNodeCluster()
    Build / JDK 11 and Scala 2.13 / org.apache.kafka.controller.QuorumControllerTest.testBalancePartitionLeaders()
    Build / JDK 8 and Scala 2.12 / org.apache.kafka.controller.QuorumControllerTest.testBalancePartitionLeaders()

In previous build (I've rebuilt it), the failed tests are:

    Build / JDK 17 and Scala 2.13 / org.apache.kafka.connect.mirror.integration.MirrorConnectorsIntegrationBaseTest.testOffsetTranslationBehindReplicationFlow()
    Build / JDK 17 and Scala 2.13 / org.apache.kafka.controller.QuorumControllerTest.testBalancePartitionLeaders()
    Build / JDK 17 and Scala 2.13 / org.apache.kafka.controller.QuorumControllerTest.testBalancePartitionLeaders()
    Build / JDK 11 and Scala 2.13 / org.apache.kafka.clients.consumer.internals.CooperativeConsumerCoordinatorTest.testOutdatedCoordinatorAssignment()
    Build / JDK 11 and Scala 2.13 / org.apache.kafka.connect.mirror.integration.MirrorConnectorsIntegrationTransactionsTest.testSyncTopicConfigs()
    Build / JDK 11 and Scala 2.13 / kafka.api.TransactionsBounceTest.testWithGroupId()
    Build / JDK 11 and Scala 2.13 / kafka.api.TransactionsTest.testBumpTransactionalEpoch(String).quorum=kraft
    Build / JDK 11 and Scala 2.13 / kafka.log.LogCleanerParameterizedIntegrationTest.[3] codec=snappy
    Build / JDK 11 and Scala 2.13 / org.apache.kafka.controller.QuorumControllerTest.testBalancePartitionLeaders()

@showuon showuon merged commit 7a6435a into apache:trunk Jun 5, 2023
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants