Skip to content

MINOR: make LogCleaner.shouldRetainRecord more clear to read#6590

Merged
hachikuji merged 3 commits intoapache:trunkfrom
FreeeeLy:origin/legibility_fix_for_LogCleaner
Apr 25, 2019
Merged

MINOR: make LogCleaner.shouldRetainRecord more clear to read#6590
hachikuji merged 3 commits intoapache:trunkfrom
FreeeeLy:origin/legibility_fix_for_LogCleaner

Conversation

@FreeeeLy
Copy link
Copy Markdown
Contributor

@FreeeeLy FreeeeLy commented Apr 17, 2019

The comments of LogCleaner.shouldRetainRecord are pretty clear to tell us when to retain a record.
However, I think the code is not so clear as the comments so that i make some changes:
val redundant = foundOffset >= 0 && record.offset < foundOffset
--->
val latest= foundOffset < 0 || record.offset >= foundOffset

if there dose not exist a message with the key, foundOffset will be -1, record.offset is larger than -1:
val latest = record.offset() >= foundOffset

@FreeeeLy
Copy link
Copy Markdown
Contributor Author

Call for review @cadonna @bbejeck @mjsax @vvcephei @guozhangwang

@FreeeeLy
Copy link
Copy Markdown
Contributor Author

Retest this,please

@FreeeeLy
Copy link
Copy Markdown
Contributor Author

JDK11 has one test failed:
kafka.api.UserQuotaTest.testThrottledProducerConsumer
java.lang.AssertionError: Client with id=QuotasTestProducer-1 should have been throttled

JDK 8 passed

@mjsax
Copy link
Copy Markdown
Member

mjsax commented Apr 19, 2019

Call for review anyof @hachikuji @gwenshap @bob-barrett @cmccabe

Comment thread core/src/main/scala/kafka/log/LogCleaner.scala Outdated
Copy link
Copy Markdown
Contributor

@bob-barrett bob-barrett 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 the patch

Comment thread core/src/main/scala/kafka/log/LogCleaner.scala Outdated
Copy link
Copy Markdown
Contributor

@hachikuji hachikuji 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 the patch!

@hachikuji hachikuji merged commit ad4a7c3 into apache:trunk Apr 25, 2019
@FreeeeLy FreeeeLy deleted the origin/legibility_fix_for_LogCleaner branch April 25, 2019 17:20
dhruvilshah3 added a commit to confluentinc/kafka that referenced this pull request Apr 29, 2019
* ak/trunk: (42 commits)
  KAFKA-8134: `linger.ms` must be a long
  KAFKA-7779; Avoid unnecessary loop iteration in leastLoadedNode (apache#6081)
  MINOR: Update Gradle to 5.4.1 and update its plugins  (apache#6436)
  MINOR: improve Session expiration notice (apache#6618)
  KAFKA-8029: In memory session store (apache#6525)
  MINOR: In-memory stores cleanup (apache#6595)
  KAFKA-7862 & KIP-345 part-one: Add static membership logic to JoinGroup protocol (apache#6177)
  KAFKA-8254: Pass Changelog as Topic in Suppress Serdes (apache#6602)
  KAFKA-7903: automatically generate OffsetCommitRequest (apache#6583)
  KAFKA-8291 : System test fix (apache#6637)
  MINOR: Do not log retriable offset commit exceptions as errors (apache#5904)
  MINOR: Fix log message error of loadTransactionMetadata (apache#6571)
  MINOR: Fix 404 security features links (apache#6634)
  MINOR: Remove an unnecessary character from broker's startup log
  MINOR: Make LogCleaner.shouldRetainRecord more readable (apache#6590)
  MINOR: Remove implicit return statement (apache#6629)
  KAFKA-8237; Untangle TopicDeleteManager and add test cases (apache#6588)
  KAFKA-8227 DOCS Fixed missing links duality of streams tables (apache#6625)
  MINOR: reformat settings.gradle to be more readable (apache#6621)
  MINOR: Correct RestServerTest formatting
  ...

 Conflicts:
	build.gradle
	settings.gradle
pengxiaolong pushed a commit to pengxiaolong/kafka that referenced this pull request Jun 14, 2019
Reviewers: Bob Barrett <bob.barrett@outlook.com>, Jason Gustafson <jason@confluent.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants