MINOR: Add log identifier/prefix printing in Log layer static functions#10742
Merged
junrao merged 4 commits intoapache:trunkfrom May 24, 2021
Merged
Conversation
Contributor
Author
|
cc @junrao for review |
ccding
approved these changes
May 21, 2021
Contributor
ccding
left a comment
There was a problem hiding this comment.
LGTM with a minor comment
showuon
reviewed
May 21, 2021
Contributor
Author
junrao
reviewed
May 21, 2021
Contributor
Author
showuon
reviewed
May 22, 2021
Member
showuon
left a comment
There was a problem hiding this comment.
Thanks for the update. 1 minor comment left. Thank you.
| logDirFailureChannel: LogDirFailureChannel, | ||
| recordVersion: RecordVersion): Option[LeaderEpochFileCache] = { | ||
| recordVersion: RecordVersion, | ||
| logPrefix: String): Option[LeaderEpochFileCache] = { |
Member
There was a problem hiding this comment.
Could we add the default logPrefix parameter value to empty string? So all the tests don't need to update.
Contributor
Author
There was a problem hiding this comment.
Introducing a default value can lead to programming error, because we could forget to pass it when it is really needed to be passed.
| val logDirFailureChannel = new LogDirFailureChannel(1) | ||
| val segments = new LogSegments(log.topicPartition) | ||
| val leaderEpochCache = Log.maybeCreateLeaderEpochCache(log.dir, log.topicPartition, logDirFailureChannel, log.config.messageFormatVersion.recordVersion) | ||
| val leaderEpochCache = Log.maybeCreateLeaderEpochCache(log.dir, log.topicPartition, logDirFailureChannel, log.config.messageFormatVersion.recordVersion, "") |
Member
There was a problem hiding this comment.
As above mentioned, if the default logPrefix is empty string, then the following change in tests are not needed.
ijuma
added a commit
to ijuma/kafka
that referenced
this pull request
May 26, 2021
…e-allocations-lz4 * apache-github/trunk: (43 commits) KAFKA-12800: Configure generator to fail on trailing JSON tokens (apache#10717) MINOR: clarify message ordering with max in-flight requests and idempotent producer (apache#10690) MINOR: Add log identifier/prefix printing in Log layer static functions (apache#10742) MINOR: update java doc for deprecated methods (apache#10722) MINOR: Fix deprecation warnings in SlidingWindowedCogroupedKStreamImplTest (apache#10703) KAFKA-12499: add transaction timeout verification (apache#10482) KAFKA-12620 Allocate producer ids on the controller (apache#10504) MINOR: Kafka Streams code samples formating unification (apache#10651) KAFKA-12808: Remove Deprecated Methods under StreamsMetrics (apache#10724) KAFKA-12522: Cast SMT should allow null value records to pass through (apache#10375) KAFKA-12820: Upgrade maven-artifact dependency to resolve CVE-2021-26291 HOTFIX: fix checkstyle issue in KAFKA-12697 KAFKA-12697: Add OfflinePartitionCount and PreferredReplicaImbalanceCount metrics to Quorum Controller (apache#10572) KAFKA-12342: Remove MetaLogShim and use RaftClient directly (apache#10705) KAFKA-12779: KIP-740, Clean up public API in TaskId and fix TaskMetadata#taskId() (apache#10735) KAFKA-12814: Remove Deprecated Method StreamsConfig getConsumerConfigs (apache#10737) MINOR: Eliminate redundant functions in LogTest suite (apache#10732) MINOR: Remove unused maxProducerIdExpirationMs parameter in Log constructor (apache#10723) MINOR: Updating files with release 2.7.1 (apache#10660) KAFKA-12809: Remove deprecated methods of Stores factory (apache#10729) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When #10478 was merged, we accidentally lost the identifier/prefix string that we used to previously log to stderr from some of the functions in the
Logclass. In this PR, I have reinstated the identifier/prefix logging in these functions, so that the debuggability is restored.Tests:
Ran existing unit tests and checked the output. Noticed that the log identifier/prefix shows up from the lines wherever it is additionally logged from now.