Skip to content

[Bug] consumer backlog eviction policy should not reset read position of the consumer #18036

Closed
HQebupt/pulsar
#5

Description

@HQebupt

Search before asking

  • I searched in the issues and found nothing similar.

Version

  • Pulsar: latest
  • JDK: 17

Minimal reproduce step

  • Run unit test: org.apache.pulsar.broker.service.BacklogQuotaManagerTest#testConsumerBacklogEvictionTimeQuota

What did you expect to see?

  1. The backlog eviction policy should not the reset read position of the consumer. It is due to wrong method for resetting mark delete position.
  2. Reduce the resetting mark delete position request.

What did you see instead?

  1. When I run the unit test, I found the cursor c1 's read position was reset by BacklogQuotaManager. The backlog eviction policy should not the reset read position of the consumer. See the following log.
2022-10-13T17:50:37,488 - INFO  - [pulsar-backlog-quota-checker-64-1:BacklogQuotaManager@89] - Backlog quota type message_age exceeded for topic [persistent://prop/ns-quota/topic3c8347406-bbe5-40e9-9f08-eced5d838a42]. Applying [consumer_backlog_eviction] policy
2022-10-13T17:50:37,492 - INFO  - [BookKeeperClientWorker-OrderedExecutor-1-0:ManagedCursorImpl@1193] - [prop/ns-quota/persistent/topic3c8347406-bbe5-40e9-9f08-eced5d838a42] Initiate reset position to 1:0 on cursor c1

2022-10-13T17:50:37,628 - INFO  - [bookkeeper-ml-scheduler-OrderedScheduler-1-0:ManagedCursorImpl$30@2963] - [prop/ns-quota/persistent/topic3c8347406-bbe5-40e9-9f08-eced5d838a42] Updated cursor c1 with ledger id 3 md-position=0:-1 rd-position=2:4
2022-10-13T17:50:37,795 - INFO  - [BookKeeperClientWorker-OrderedExecutor-1-0:ManagedCursorImpl@1193] - [prop/ns-quota/persistent/topic3c8347406-bbe5-40e9-9f08-eced5d838a42] Initiate reset position to 2:0 on cursor c1
2022-10-13T17:50:37,799 - INFO  - [BookKeeperClientWorker-OrderedExecutor-1-0:ManagedCursorImpl$9@1245] - [prop/ns-quota/persistent/topic3c8347406-bbe5-40e9-9f08-eced5d838a42] reset position to 2:0 skipping from current read position 1:0 on cursor c1

  1. There are a lot of redundant reset mark delete position requests in the log.

image

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Activity

  1. added
    type/bug
    on Oct 13, 2022
  2. self-assigned this
    on Oct 13, 2022
  3. added 2 commits that reference this issue on Oct 19, 2022
    98e9089
    7404e0d
  4. added 2 commits that reference this issue on Nov 4, 2022
    ea22bec
    0b7140b
  5. added a commit that references this issue on Nov 9, 2022
    22371c2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

type/bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions