Skip to content

Comments

[fix][broker] fix aging subscription accidentally when expiration time not arrive #23692

Closed
pengxiangrui127 wants to merge 1 commit intoapache:masterfrom
pengxiangrui127:fix_accidentally_aging_subscription
Closed

[fix][broker] fix aging subscription accidentally when expiration time not arrive #23692
pengxiangrui127 wants to merge 1 commit intoapache:masterfrom
pengxiangrui127:fix_accidentally_aging_subscription

Conversation

@pengxiangrui127
Copy link
Contributor

@pengxiangrui127 pengxiangrui127 commented Dec 8, 2024

Motivation

As we known, the subscription will be aging when the configuration of subscriptionExpirationTimeMinutes is positive.
The aging operation is dependent on the lastActive timestamp of subscription cursor, which only updated while consumers changing.
If broker is stable and consumer list not change, the subscriptin lastActive timestamp could be a very old time.
It may result in the subscriptin being deleted accidentally when broker suffer sudden exit and start up again.

Modifications

Update lastActive timestamp when the method of checkInactiveSubscriptions in PersistentTopic.java is invoked.

Verifying this change

  • Make sure that the change passes the CI checks.

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

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

Matching PR in forked repository

PR in forked repository:

@github-actions
Copy link

github-actions bot commented Dec 8, 2024

@pengxiangrui127 Please add the following content to your PR description and select a checkbox:

- [ ] `doc` <!-- Your PR contains doc changes -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->

@github-actions github-actions bot added doc-label-missing doc-not-needed Your PR changes do not impact docs and removed doc-label-missing labels Dec 8, 2024
@pengxiangrui127 pengxiangrui127 changed the title [Bug][broker] fix aging subscription accidentally when expiration time not arrive [fix][broker] fix aging subscription accidentally when expiration time not arrive Dec 8, 2024
Copy link
Member

@thetumbled thetumbled left a comment

Choose a reason for hiding this comment

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

Simillar change in #21692, which has been closed.
The problem you are worried about is fixed by #22794.

@lhotari
Copy link
Member

lhotari commented Dec 9, 2024

Closing this PR since the issue is handled by #22794.

@lhotari lhotari closed this Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-not-needed Your PR changes do not impact docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants