Skip to content

KAFKA-13710: bring the InvalidTimestampException back for record error#11853

Merged
showuon merged 2 commits intoapache:trunkfrom
showuon:KAFKA-13710
Mar 8, 2022
Merged

KAFKA-13710: bring the InvalidTimestampException back for record error#11853
showuon merged 2 commits intoapache:trunkfrom
showuon:KAFKA-13710

Conversation

@showuon
Copy link
Copy Markdown
Member

@showuon showuon commented Mar 6, 2022

In #11830, we remove the InvalidTimestampException case and failed 2 test cases. It looks like we intended to treat the INVALID_TIMESTAMP error as special case. So, added back the INVALID_TIMESTAMP case to fix the tests.

Failed test:
kafka.server.ProduceRequestTest.testProduceWithInvalidTimestamp()
kafka.api.PlaintextProducerSendTest.testSendWithInvalidCreateTime()

Committer Checklist (excluded from commit message)

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

Comment on lines 1399 to +1401
// if there is a mix of both regular InvalidRecordException and InvalidTimestampException,
// InvalidTimestampException is no longer takes precedence. The type of invalidException
// is unified as InvalidRecordException
assertTrue(e.invalidException.isInstanceOf[InvalidRecordException])
// InvalidTimestampException takes precedence
assertTrue(e.invalidException.isInstanceOf[InvalidTimestampException])
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Since v2.4, (PR: #7612), we intentionally let InvalidTimestampException take precedence. I think we should keep the same behavior as before.

Copy link
Copy Markdown
Contributor

@guozhangwang guozhangwang left a comment

Choose a reason for hiding this comment

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

LGTM.

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.

3 participants