Skip to content

KAFKA-17026: Implement updateCacheAndOffsets functionality on LSO movement #16459

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

Merged
merged 11 commits into from
Jul 3, 2024

Conversation

adixitconfluent
Copy link
Contributor

@adixitconfluent adixitconfluent commented Jun 26, 2024

About

Implemented the functionality which takes care of archiving the records when LSO moves past them. Implemented the following functions -

  1. updateCacheAndOffsets - Updates the cached state, start and end offsets of the share partition as per the new log start offset. The method is called when the log start offset is moved for the share partition.
  2. archiveAvailableRecordsOnLsoMovement - This function archives all the available records when they are behind the LSO.
  3. archivePerOffsetBatchRecords - It archives all the available records in the per offset tracked batch passed to this function.
  4. archiveCompleteBatch - It archives all the available records of the complete batch passed to this function.

Testing

The added functionality has been tested with unit tests.

Suppression

In order for build to pass, I had to add JavaNCSS suppression for SharePartitionTest. It takes into account the total lines of non-commented source code. Agreed, that we can optimize the current SharePartitionTest code at a few places, however, when we add new test cases, we will again breach this limit which is currently set at 1500. Hence, adding the suppression made sense to me.

@adixitconfluent adixitconfluent force-pushed the kafka-17026 branch 2 times, most recently from 4a844ef to a11e394 Compare June 27, 2024 10:07
@adixitconfluent adixitconfluent marked this pull request as ready for review June 27, 2024 10:55
Copy link
Contributor

@apoorvmittal10 apoorvmittal10 left a comment

Choose a reason for hiding this comment

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

LGTM overall, some minor comments.

Copy link
Contributor

@apoorvmittal10 apoorvmittal10 left a comment

Choose a reason for hiding this comment

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

LGTM! Just minor suggestions.

Copy link
Member

@AndrewJSchofield AndrewJSchofield left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

@omkreddy omkreddy left a comment

Choose a reason for hiding this comment

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

@adixitconfluent Thanks for the PR. LGTM

@omkreddy omkreddy merged commit 35baa0a into apache:trunk Jul 3, 2024
1 check failed
@adixitconfluent adixitconfluent deleted the kafka-17026 branch July 3, 2024 10:44
chirag-wadhwa5 pushed a commit to chirag-wadhwa5/kafka that referenced this pull request Jul 3, 2024
…ement (apache#16459)

Implemented the functionality which takes care of archiving the records when LSO moves past them. Implemented the following functions -

1. updateCacheAndOffsets - Updates the cached state, start and end offsets of the share partition as per the new log start offset. The method is called when the log start offset is moved for the share partition.
2. archiveAvailableRecordsOnLsoMovement - This function archives all the available records when they are behind the LSO.
3. archivePerOffsetBatchRecords - It archives all the available records in the per offset tracked batch passed to this function.
4. archiveCompleteBatch - It archives all the available records of the complete batch passed to this function.

Reviewers:  Andrew Schofield <[email protected]>,Apoorv Mittal <[email protected]>, Manikumar Reddy <[email protected]>
abhi-ksolves pushed a commit to ksolves/kafka that referenced this pull request Jul 31, 2024
…ement (apache#16459)

Implemented the functionality which takes care of archiving the records when LSO moves past them. Implemented the following functions -

1. updateCacheAndOffsets - Updates the cached state, start and end offsets of the share partition as per the new log start offset. The method is called when the log start offset is moved for the share partition.
2. archiveAvailableRecordsOnLsoMovement - This function archives all the available records when they are behind the LSO.
3. archivePerOffsetBatchRecords - It archives all the available records in the per offset tracked batch passed to this function.
4. archiveCompleteBatch - It archives all the available records of the complete batch passed to this function.

Reviewers:  Andrew Schofield <[email protected]>,Apoorv Mittal <[email protected]>, Manikumar Reddy <[email protected]>
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