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][broker] Skip reading more entries for a pending read with no more entries #16400

Conversation

BewareMyPower
Copy link
Contributor

@BewareMyPower BewareMyPower commented Jul 5, 2022

Motivation

Related issue: streamnative/kop#1379

KoP uses reader on a single partition of a compacted topic and we
observed a lot of logs like:

Error reading entries at 928511:1 : We can only have a single waiting callback

It happened on a ManagedCursorImpl when hasMoreEntries returns
false, asyncReadEntriesOrWait is called for multiple times before
cancelPendingReadRequest or new messages arrived.

Modifications

Throw a ConcurrentWaitCallbackException instead of a raw
ManagedLedgerException when there are more wait callbacks. Then check
this exception type and skip the following steps in
PersistentDispatcherSingleActiveConsumer#internalReadEntriesFailed.

Documentation

Check the box below or label this PR directly.

Need to update docs?

  • doc-required
    (Your PR needs to update docs and you will update later)

  • doc-not-needed
    (Please explain why)

  • doc
    (Your PR contains doc changes)

  • doc-complete
    (Docs have been already added)

@github-actions
Copy link

github-actions bot commented Jul 5, 2022

@BewareMyPower Please provide a correct documentation label for your PR.
Instructions see Pulsar Documentation Label Guide.

@github-actions github-actions bot added doc-not-needed Your PR changes do not impact docs and removed doc-label-missing labels Jul 5, 2022
@BewareMyPower BewareMyPower force-pushed the bewaremypower/compacted-topic-read-thread-safety branch from 344b3d9 to b029923 Compare July 6, 2022 03:50
@BewareMyPower BewareMyPower force-pushed the bewaremypower/compacted-topic-read-thread-safety branch 2 times, most recently from 47d40f0 to b3a54b1 Compare July 11, 2022 08:45
…re entries

### Motivation

Related issue: streamnative/kop#1379

KoP uses reader on a single partition of a compacted topic and we
observed a lot of logs like:

> Error reading entries at 928511:1 : We can only have a single waiting callback

It happened on a `ManagedCursorImpl` when `hasMoreEntries` returns
false, `asyncReadEntriesOrWait` is called for multiple times before
`cancelPendingReadRequest` or new messages arrived.

### Modifications

Throw a `ConcurrentWaitCallbackException` instead of a raw
`ManagedLedgerException` when there are more wait callbacks. Then check
this exception type and skip the following steps in
`PersistentDispatcherSingleActiveConsumer#internalReadEntriesFailed`.
@BewareMyPower BewareMyPower force-pushed the bewaremypower/compacted-topic-read-thread-safety branch from b3a54b1 to e8ef957 Compare July 12, 2022 14:25
@codelipenghui codelipenghui merged commit 5ec4e3d into apache:master Jul 13, 2022
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Jul 13, 2022
…re entries (apache#16400)

### Motivation

Related issue: streamnative/kop#1379

KoP uses reader on a single partition of a compacted topic and we
observed a lot of logs like:

> Error reading entries at 928511:1 : We can only have a single waiting callback

It happened on a `ManagedCursorImpl` when `hasMoreEntries` returns
false, `asyncReadEntriesOrWait` is called for multiple times before
`cancelPendingReadRequest` or new messages arrived.

### Modifications

Throw a `ConcurrentWaitCallbackException` instead of a raw
`ManagedLedgerException` when there are more wait callbacks. Then check
this exception type and skip the following steps in
`PersistentDispatcherSingleActiveConsumer#internalReadEntriesFailed`.

(cherry picked from commit 5ec4e3d)
@BewareMyPower BewareMyPower deleted the bewaremypower/compacted-topic-read-thread-safety branch July 13, 2022 08:02
wuxuanqicn pushed a commit to wuxuanqicn/pulsar that referenced this pull request Jul 14, 2022
…re entries (apache#16400)

### Motivation

Related issue: streamnative/kop#1379

KoP uses reader on a single partition of a compacted topic and we
observed a lot of logs like:

> Error reading entries at 928511:1 : We can only have a single waiting callback

It happened on a `ManagedCursorImpl` when `hasMoreEntries` returns
false, `asyncReadEntriesOrWait` is called for multiple times before
`cancelPendingReadRequest` or new messages arrived.

### Modifications

Throw a `ConcurrentWaitCallbackException` instead of a raw
`ManagedLedgerException` when there are more wait callbacks. Then check
this exception type and skip the following steps in
`PersistentDispatcherSingleActiveConsumer#internalReadEntriesFailed`.
codelipenghui pushed a commit that referenced this pull request Jul 15, 2022
…re entries (#16400)

### Motivation

Related issue: streamnative/kop#1379

KoP uses reader on a single partition of a compacted topic and we
observed a lot of logs like:

> Error reading entries at 928511:1 : We can only have a single waiting callback

It happened on a `ManagedCursorImpl` when `hasMoreEntries` returns
false, `asyncReadEntriesOrWait` is called for multiple times before
`cancelPendingReadRequest` or new messages arrived.

### Modifications

Throw a `ConcurrentWaitCallbackException` instead of a raw
`ManagedLedgerException` when there are more wait callbacks. Then check
this exception type and skip the following steps in
`PersistentDispatcherSingleActiveConsumer#internalReadEntriesFailed`.

(cherry picked from commit 5ec4e3d)
mattisonchao pushed a commit that referenced this pull request Jul 15, 2022
…re entries (#16400)

### Motivation

Related issue: streamnative/kop#1379

KoP uses reader on a single partition of a compacted topic and we
observed a lot of logs like:

> Error reading entries at 928511:1 : We can only have a single waiting callback

It happened on a `ManagedCursorImpl` when `hasMoreEntries` returns
false, `asyncReadEntriesOrWait` is called for multiple times before
`cancelPendingReadRequest` or new messages arrived.

### Modifications

Throw a `ConcurrentWaitCallbackException` instead of a raw
`ManagedLedgerException` when there are more wait callbacks. Then check
this exception type and skip the following steps in
`PersistentDispatcherSingleActiveConsumer#internalReadEntriesFailed`.

(cherry picked from commit 5ec4e3d)
@mattisonchao mattisonchao added the cherry-picked/branch-2.9 Archived: 2.9 is end of life label Jul 15, 2022
BewareMyPower added a commit that referenced this pull request Aug 2, 2022
…re entries (#16400)

### Motivation

Related issue: streamnative/kop#1379

KoP uses reader on a single partition of a compacted topic and we
observed a lot of logs like:

> Error reading entries at 928511:1 : We can only have a single waiting callback

It happened on a `ManagedCursorImpl` when `hasMoreEntries` returns
false, `asyncReadEntriesOrWait` is called for multiple times before
`cancelPendingReadRequest` or new messages arrived.

### Modifications

Throw a `ConcurrentWaitCallbackException` instead of a raw
`ManagedLedgerException` when there are more wait callbacks. Then check
this exception type and skip the following steps in
`PersistentDispatcherSingleActiveConsumer#internalReadEntriesFailed`.

(cherry picked from commit 5ec4e3d)
@BewareMyPower BewareMyPower added the cherry-picked/branch-2.8 Archived: 2.8 is end of life label Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/broker cherry-picked/branch-2.8 Archived: 2.8 is end of life cherry-picked/branch-2.9 Archived: 2.9 is end of life cherry-picked/branch-2.10 doc-not-needed Your PR changes do not impact docs release/2.8.4 release/2.9.4 release/2.10.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.

4 participants