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

[Compaction] Do not move the non-durable cursor position when trimming ledgers while topic with compaction #12602

Conversation

codelipenghui
Copy link
Contributor

Motivation

For the non-durable cursor, the ledgers trimming task will cause skip the removed ledgers
to avoid readers introduced backlogs and make sure the data can be removed if over the retention,
more details to see #6787.

But for a topic that enabled compaction, this will lead to the reader skipping the compacted data.
The newly added test can illustrate this problem well. For reading compacted data, reading a message ID
that earlier that the first message ID of the original data is normal behavior, so we should not
move forward the cursor which will read the compacted data.

Documentation

Check the box below and label this PR (if you have committer privilege).

Need to update docs?

  • doc-required

    (If you need help on updating docs, create a doc issue)

  • no-need-doc

    (Please explain why)

  • doc

    (If this PR contains doc changes)

…g ledgers while topic with compaction.

For the non-durable cursor, the ledgers trimming task will cause skip the removed ledgers
to avoid readers introduced backlogs and make sure the data can be removed if over the retention,
more details to see apache#6787.

But for a topic which enabled compaction, this will lead to the reader skips the compacted data.
The new added test can illustrate this problem well. For reading compacted data, reading a message ID
that earlier that the first message ID of the original data is a normal behavior, so we should not
move forward the cursor which will read the compacted data.
@codelipenghui codelipenghui self-assigned this Nov 3, 2021
@codelipenghui codelipenghui added this to the 2.10.0 milestone Nov 3, 2021
@github-actions
Copy link

github-actions bot commented Nov 3, 2021

@codelipenghui:Thanks for providing doc info!

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Nov 3, 2021
@codelipenghui codelipenghui added release/2.8.2 release/2.9.1 and removed doc-not-needed Your PR changes do not impact docs labels Nov 3, 2021
@github-actions
Copy link

github-actions bot commented Nov 3, 2021

@codelipenghui:Thanks for your contribution. For this PR, do we need to update docs?
(The PR template contains info about doc, which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)

1 similar comment
@github-actions
Copy link

github-actions bot commented Nov 3, 2021

@codelipenghui:Thanks for your contribution. For this PR, do we need to update docs?
(The PR template contains info about doc, which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)

@codelipenghui
Copy link
Contributor Author

/pulsarbot run-failure-checks

@Anonymitaet Anonymitaet added doc-not-needed Your PR changes do not impact docs and removed doc-label-missing labels Nov 4, 2021
@merlimat merlimat added the type/bug The PR fixed a bug or issue reported a bug label Nov 4, 2021
@merlimat merlimat merged commit a6b1b34 into apache:master Nov 4, 2021
@codelipenghui codelipenghui deleted the penghui/fix-read-compacted-lost-data-trimming-ledger branch November 5, 2021 00:33
codelipenghui added a commit that referenced this pull request Nov 5, 2021
…g ledgers while topic with compaction (#12602)

* [Compaction] Do not move the non-durable cursor position when trimming ledgers while topic with compaction.

For the non-durable cursor, the ledgers trimming task will cause skip the removed ledgers
to avoid readers introduced backlogs and make sure the data can be removed if over the retention,
more details to see #6787.

But for a topic which enabled compaction, this will lead to the reader skips the compacted data.
The new added test can illustrate this problem well. For reading compacted data, reading a message ID
that earlier that the first message ID of the original data is a normal behavior, so we should not
move forward the cursor which will read the compacted data.

* Fix checkstyle.

* Fix tests.

* Fix tests.

(cherry picked from commit a6b1b34)
@codelipenghui codelipenghui added the cherry-picked/branch-2.8 Archived: 2.8 is end of life label Nov 5, 2021
eolivelli pushed a commit to eolivelli/pulsar that referenced this pull request Nov 29, 2021
…g ledgers while topic with compaction (apache#12602)

* [Compaction] Do not move the non-durable cursor position when trimming ledgers while topic with compaction.

For the non-durable cursor, the ledgers trimming task will cause skip the removed ledgers
to avoid readers introduced backlogs and make sure the data can be removed if over the retention,
more details to see apache#6787.

But for a topic which enabled compaction, this will lead to the reader skips the compacted data.
The new added test can illustrate this problem well. For reading compacted data, reading a message ID
that earlier that the first message ID of the original data is a normal behavior, so we should not
move forward the cursor which will read the compacted data.

* Fix checkstyle.

* Fix tests.

* Fix tests.
codelipenghui added a commit that referenced this pull request Dec 20, 2021
…g ledgers while topic with compaction (#12602)

* [Compaction] Do not move the non-durable cursor position when trimming ledgers while topic with compaction.

For the non-durable cursor, the ledgers trimming task will cause skip the removed ledgers
to avoid readers introduced backlogs and make sure the data can be removed if over the retention,
more details to see #6787.

But for a topic which enabled compaction, this will lead to the reader skips the compacted data.
The new added test can illustrate this problem well. For reading compacted data, reading a message ID
that earlier that the first message ID of the original data is a normal behavior, so we should not
move forward the cursor which will read the compacted data.

* Fix checkstyle.

* Fix tests.

* Fix tests.

(cherry picked from commit a6b1b34)
@codelipenghui codelipenghui added the cherry-picked/branch-2.9 Archived: 2.9 is end of life label Dec 20, 2021
@codelipenghui codelipenghui restored the penghui/fix-read-compacted-lost-data-trimming-ledger branch May 17, 2022 01:23
@codelipenghui codelipenghui deleted the penghui/fix-read-compacted-lost-data-trimming-ledger branch May 17, 2022 01:29
@Technoboy- Technoboy- added the cherry-picked/branch-2.7 Archived: 2.7 is end of life label Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/broker area/compaction cherry-picked/branch-2.7 Archived: 2.7 is end of life cherry-picked/branch-2.8 Archived: 2.8 is end of life cherry-picked/branch-2.9 Archived: 2.9 is end of life doc-not-needed Your PR changes do not impact docs release/2.7.5 release/2.8.2 release/2.9.2 type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants