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-14477: Move LogValidator and related to storage module #13012

Merged
merged 2 commits into from Dec 22, 2022

Conversation

ijuma
Copy link
Contributor

@ijuma ijuma commented Dec 17, 2022

Also improved LogValidatorTest to cover a bug that was originally
only caught by LogAppendTimeTest.

For broader context on this change, please check:

Committer Checklist (excluded from commit message)

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

@ijuma ijuma force-pushed the kafka-14477-move-log-validator-to-storage branch 6 times, most recently from 023937d to c2c5d3d Compare December 21, 2022 04:14
@ijuma ijuma requested a review from junrao December 21, 2022 04:19
@ijuma ijuma marked this pull request as ready for review December 21, 2022 04:19
@ijuma
Copy link
Contributor Author

ijuma commented Dec 21, 2022

cc @satishd

@ijuma ijuma force-pushed the kafka-14477-move-log-validator-to-storage branch from c2c5d3d to efe9114 Compare December 21, 2022 04:30
@ijuma
Copy link
Contributor Author

ijuma commented Dec 21, 2022

JDK 17 build passed, the other failures are flaky. Re-running the test suite just in case.

Copy link
Contributor

@junrao junrao left a comment

Choose a reason for hiding this comment

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

@ijuma : Thanks for the PR. Just a few comments.

def recordInvalidMagic(): Unit =
allTopicsStats.invalidMagicNumberRecordsPerSec.mark()

def recordInvalidOffset(): Unit =
Copy link
Contributor

Choose a reason for hiding this comment

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

recordInvalidOffset() and recordInvalidSequence() do the same thing. Should we just have a single method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seemed a bit arbitrary that we combined these into the same metric. I thought it may be cleaner to define the interface in a general way and then have the implementation match the current behavior. I don't feel too strongly though, so if you still prefer to combine these into the same method, I can do it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good. We can keep this as it is then.

extends RuntimeException(invalidException) {
public class PrimitiveRefTest {
@Test
public void testLongRef() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add a similar test for IntRef() too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IntRef was there before, but yes, I can take the chance to improve coverage.

interBrokerProtocolVersion
)
validator.validateMessagesAndAssignOffsets(offset,
validatorMetricsRecorder(brokerTopicStats.allTopicsStats),
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we just create a single instance of MetricsRecorder and reuse it for all appends?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea.

@ijuma
Copy link
Contributor Author

ijuma commented Dec 21, 2022

@junrao Pushed a change that addresses two of the review comments. I left a comment for the other review comment.

Copy link
Contributor

@junrao junrao left a comment

Choose a reason for hiding this comment

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

@ijuma : Thanks for the updated PR. LGTM

@ijuma
Copy link
Contributor Author

ijuma commented Dec 22, 2022

JDK 17 build passed, other build failures are unrelated.

@ijuma ijuma merged commit e8232ed into apache:trunk Dec 22, 2022
@ijuma ijuma deleted the kafka-14477-move-log-validator-to-storage branch December 22, 2022 00:57
guozhangwang pushed a commit to guozhangwang/kafka that referenced this pull request Jan 25, 2023
…13012)

Also improved `LogValidatorTest` to cover a bug that was originally
only caught by `LogAppendTimeTest`.

For broader context on this change, please check:

* KAFKA-14470: Move log layer to storage module

Reviewers: Jun Rao <junrao@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants