Skip to content

[fix][broker] fix replicated subscriptions for transactional messages#22452

Merged
poorbarcode merged 26 commits into
apache:masterfrom
thetumbled:Fix_lastDataMessagePublishedTimestamp
May 13, 2024
Merged

[fix][broker] fix replicated subscriptions for transactional messages#22452
poorbarcode merged 26 commits into
apache:masterfrom
thetumbled:Fix_lastDataMessagePublishedTimestamp

Conversation

@thetumbled

@thetumbled thetumbled commented Apr 7, 2024

Copy link
Copy Markdown
Member

Motivation

In non-transactional production, we update the LastDataMessagePublishedTimestamp when the message is persisted successfully. But in transactional production, we do not update LastDataMessagePublishedTimestamp, which will impact the feature ReplicatedSubscription.

Modifications

Update the LastDataMessagePublishedTimestamp when the max read position move forward.

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.

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: thetumbled#45

@thetumbled

Copy link
Copy Markdown
Member Author

@BewareMyPower BewareMyPower left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you add a test for it?

@thetumbled

Copy link
Copy Markdown
Member Author

Could you add a test for it?

Added, PTAL, thanks.

@liangyepianzhou

Copy link
Copy Markdown
Contributor

@thetumbled You need to add a test related to transaction, right?

@thetumbled

Copy link
Copy Markdown
Member Author

@thetumbled You need to add a test related to transaction, right?

testUpdateLastDataMessagePublishedTimestampForTransactionalPublish()

@thetumbled thetumbled changed the title [fix] [broker] fix not updating LastDataMessagePublishedTimestamp in transactional production. [fix][broker] fix replicated subscriptions for transactional messages Apr 9, 2024
@thetumbled thetumbled force-pushed the Fix_lastDataMessagePublishedTimestamp branch from e27fd14 to 6fae3a3 Compare April 9, 2024 08:00
@thetumbled

Copy link
Copy Markdown
Member Author

/pulsarbot rerun-failure-checks

1 similar comment
@thetumbled

Copy link
Copy Markdown
Member Author

/pulsarbot rerun-failure-checks

@congbobo184

Copy link
Copy Markdown
Contributor
Error: org.apache.pulsar.broker.service.ReplicatorSubscriptionWithTransactionTest.testReplicatedSubscriptionWhenReplicatorProducerIsClosed Time elapsed: 12.567 s <<< FAILURE!
org.awaitility.core.ConditionTimeoutException: Assertion condition defined as a org.apache.pulsar.broker.service.ReplicatorSubscriptionTest expected object to not be null within 10 seconds.

Pulsar CI / CI - Unit - Brokers - Broker Group 1 (pull_request) test is not stable, please check the reason

@thetumbled

Copy link
Copy Markdown
Member Author
Error: org.apache.pulsar.broker.service.ReplicatorSubscriptionWithTransactionTest.testReplicatedSubscriptionWhenReplicatorProducerIsClosed Time elapsed: 12.567 s <<< FAILURE!
org.awaitility.core.ConditionTimeoutException: Assertion condition defined as a org.apache.pulsar.broker.service.ReplicatorSubscriptionTest expected object to not be null within 10 seconds.

Pulsar CI / CI - Unit - Brokers - Broker Group 1 (pull_request) test is not stable, please check the reason

I have fixed the test code, please help to trigger the CI again, thanks.

@thetumbled

Copy link
Copy Markdown
Member Author

/pulsarbot rerun-failure-checks

2 similar comments
@thetumbled

Copy link
Copy Markdown
Member Author

/pulsarbot rerun-failure-checks

@thetumbled

Copy link
Copy Markdown
Member Author

/pulsarbot rerun-failure-checks

@dao-jun

dao-jun commented May 13, 2024

Copy link
Copy Markdown
Member

@poorbarcode any more change requests?

@thetumbled

Copy link
Copy Markdown
Member Author

PTAL, thanks. @poorbarcode

@poorbarcode poorbarcode merged commit 9fd1b61 into apache:master May 13, 2024
@lhotari

lhotari commented May 14, 2024

Copy link
Copy Markdown
Member

cherry-picking this to branch-3.0 . it looks like #21816 and #22656 need to be cherry-picked before this one to reduce merge conflicts.

@thetumbled

Copy link
Copy Markdown
Member Author

cherry-picking this to branch-3.0 . it looks like #21816 and #22656 need to be cherry-picked before this one to reduce merge conflicts.

Hi, Lari. You can cherry pick #22656 into branch-3.0 without conflict, and i can help to cherry pick this pr if there are any conflict.

@lhotari

lhotari commented May 14, 2024

Copy link
Copy Markdown
Member

I'm giving up on cherry-picking #21816 since that's too large change. I'll check what the conflicts are when applying only #22656 and #22452.

lhotari pushed a commit that referenced this pull request May 14, 2024
lhotari added a commit that referenced this pull request May 14, 2024
…#22452)

(cherry picked from commit 9fd1b61)

# Conflicts:
#	pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
nikhil-ctds pushed a commit to datastax/pulsar that referenced this pull request May 15, 2024
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request May 16, 2024
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.