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

[fix] [ml] Reader can set read-pos to a deleted ledger #21248

Merged
merged 4 commits into from
Oct 8, 2023

Conversation

poorbarcode
Copy link
Contributor

Motivation

After trimming ledgers, the variable lastConfirmedEntry of the managed ledger might rely on a deleted ledger(the latest ledger which contains data).

There is a bug that makes pulsar allow users to set the start read position to an unexisting ledger or a deleted ledger when creating a subscription. This makes the backlog and markDeletedPosition wrong.

See: https://github.com/apache/pulsar/blob/master/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java#L3630-L3654

public boolean isValidPosition(PositionImpl position) {
   ...
   ...
   ...
    } else if (position.getLedgerId() == lastConfirmedEntry.getLedgerId()) {
        return position.getEntryId() <= (lastConfirmedEntry.getEntryId() + 1);
    } else {
   ...
   ...
   ...
}

Modifications

Fix the bug.

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository: x

@poorbarcode poorbarcode self-assigned this Sep 25, 2023
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Sep 25, 2023
@poorbarcode poorbarcode added release/3.0.2 release/2.11.3 release/2.10.6 type/bug The PR fixed a bug or issue reported a bug and removed doc-not-needed Your PR changes do not impact docs labels Sep 25, 2023
@poorbarcode poorbarcode added this to the 3.2.0 milestone Sep 25, 2023
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Sep 25, 2023
@codelipenghui
Copy link
Contributor

/pulsarbot run-failure-checks

@poorbarcode
Copy link
Contributor Author

rebase master

@poorbarcode poorbarcode merged commit 4ee5cd7 into apache:master Oct 8, 2023
44 of 45 checks passed
liangyuanpeng pushed a commit to liangyuanpeng/pulsar that referenced this pull request Oct 11, 2023
### Motivation

After trimming ledgers, the variable `lastConfirmedEntry` of the managed ledger might rely on a deleted ledger(the latest ledger which contains data).

There is a bug that makes pulsar allow users to set the start read position to an unexisting ledger or a deleted ledger when creating a subscription. This makes the `backlog` and `markDeletedPosition` wrong. 

### Modifications

Fix the bug.
poorbarcode added a commit that referenced this pull request Oct 11, 2023
### Motivation

After trimming ledgers, the variable `lastConfirmedEntry` of the managed ledger might rely on a deleted ledger(the latest ledger which contains data).

There is a bug that makes pulsar allow users to set the start read position to an unexisting ledger or a deleted ledger when creating a subscription. This makes the `backlog` and `markDeletedPosition` wrong.

### Modifications

Fix the bug.

(cherry picked from commit 4ee5cd7)
poorbarcode added a commit that referenced this pull request Oct 11, 2023
After trimming ledgers, the variable `lastConfirmedEntry` of the managed ledger might rely on a deleted ledger(the latest ledger which contains data).

There is a bug that makes pulsar allow users to set the start read position to an unexisting ledger or a deleted ledger when creating a subscription. This makes the `backlog` and `markDeletedPosition` wrong.

Fix the bug.

(cherry picked from commit 4ee5cd7)
poorbarcode added a commit that referenced this pull request Oct 11, 2023
After trimming ledgers, the variable `lastConfirmedEntry` of the managed ledger might rely on a deleted ledger(the latest ledger which contains data).

There is a bug that makes pulsar allow users to set the start read position to an unexisting ledger or a deleted ledger when creating a subscription. This makes the `backlog` and `markDeletedPosition` wrong.

Fix the bug.

(cherry picked from commit 4ee5cd7)
vinayakmalik95 pushed a commit to tmdc-io/pulsar that referenced this pull request Oct 12, 2023
### Motivation

After trimming ledgers, the variable `lastConfirmedEntry` of the managed ledger might rely on a deleted ledger(the latest ledger which contains data).

There is a bug that makes pulsar allow users to set the start read position to an unexisting ledger or a deleted ledger when creating a subscription. This makes the `backlog` and `markDeletedPosition` wrong. 

### Modifications

Fix the bug.
mukesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Apr 15, 2024
### Motivation

After trimming ledgers, the variable `lastConfirmedEntry` of the managed ledger might rely on a deleted ledger(the latest ledger which contains data).

There is a bug that makes pulsar allow users to set the start read position to an unexisting ledger or a deleted ledger when creating a subscription. This makes the `backlog` and `markDeletedPosition` wrong.

### Modifications

Fix the bug.

(cherry picked from commit 4ee5cd7)
(cherry picked from commit dd28bb4)
mukesh-ctds added a commit to datastax/pulsar that referenced this pull request Apr 16, 2024
mukesh-ctds added a commit to datastax/pulsar that referenced this pull request Apr 17, 2024
mukesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Apr 17, 2024
### Motivation

After trimming ledgers, the variable `lastConfirmedEntry` of the managed ledger might rely on a deleted ledger(the latest ledger which contains data).

There is a bug that makes pulsar allow users to set the start read position to an unexisting ledger or a deleted ledger when creating a subscription. This makes the `backlog` and `markDeletedPosition` wrong.

### Modifications

Fix the bug.

(cherry picked from commit 4ee5cd7)
(cherry picked from commit dd28bb4)
mukesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Apr 19, 2024
### Motivation

After trimming ledgers, the variable `lastConfirmedEntry` of the managed ledger might rely on a deleted ledger(the latest ledger which contains data).

There is a bug that makes pulsar allow users to set the start read position to an unexisting ledger or a deleted ledger when creating a subscription. This makes the `backlog` and `markDeletedPosition` wrong.

### Modifications

Fix the bug.

(cherry picked from commit 4ee5cd7)
(cherry picked from commit dd28bb4)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Apr 23, 2024
### Motivation

After trimming ledgers, the variable `lastConfirmedEntry` of the managed ledger might rely on a deleted ledger(the latest ledger which contains data).

There is a bug that makes pulsar allow users to set the start read position to an unexisting ledger or a deleted ledger when creating a subscription. This makes the `backlog` and `markDeletedPosition` wrong.

### Modifications

Fix the bug.

(cherry picked from commit 4ee5cd7)
(cherry picked from commit dd28bb4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants