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

[Transaction] Support consume transaction messages. #7781

Merged
merged 9 commits into from
Aug 14, 2020

Conversation

gaoran10
Copy link
Contributor

@gaoran10 gaoran10 commented Aug 7, 2020

Master Issue: #2664

Fix https://github.com/streamnative/pulsar/issues/1304

Motivation

Currently, the consumer can't receive transaction messages.

Modifications

Support process the commit marker in the topic partition and fetch transaction messages from TransactionBuffer.

Verifying this change

  • Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:

  • Added unit test for consuming transaction messages
    org.apache.pulsar.broker.transaction.TransactionConsumeTest

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

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API: (yes)
  • The schema: (no)
  • The default values of configurations: (no)
  • The wire protocol: (no)
  • The rest endpoints: (no)
  • The admin cli options: (no)
  • Anything that affects deployment: (no)

Documentation

  • Does this pull request introduce a new feature? (no)

@gaoran10 gaoran10 changed the title Support consume transaction messages. [Transaction] Support consume transaction messages. Aug 7, 2020
@gaoran10
Copy link
Contributor Author

gaoran10 commented Aug 8, 2020

/pulsarbot run-failure-checks

1 similar comment
@gaoran10
Copy link
Contributor Author

gaoran10 commented Aug 8, 2020

/pulsarbot run-failure-checks

@codelipenghui codelipenghui added this to the 2.7.0 milestone Aug 10, 2020
private void read(ConcurrentLinkedQueue<TxnID> transactionQueue,
int readMessageNum, Object ctx,
AsyncCallbacks.ReadEntriesCallback readEntriesCallback) {
final TxnID txnID = transactionQueue.peek();
Copy link
Contributor

Choose a reason for hiding this comment

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

It's might peek null here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I'll add a check.

Comment on lines 60 to 62
private void read(ConcurrentLinkedQueue<TxnID> transactionQueue,
int readMessageNum, Object ctx,
AsyncCallbacks.ReadEntriesCallback readEntriesCallback) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the read txn message count is the size of the transactionQueue ? I did not understand this method, is the transactionQueue only stores the first txn ID? I noticed you have only peek one item from this queue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll adjust this logic.

@gaoran10
Copy link
Contributor Author

/pulsarbot run-failure-checks

@gaoran10
Copy link
Contributor Author

/pulsarbot run-failure-checks

@codelipenghui codelipenghui merged commit 6e7d1a8 into apache:master Aug 14, 2020
huangdx0726 pushed a commit to huangdx0726/pulsar that referenced this pull request Aug 24, 2020
Master Issue: apache#2664 

Fix https://github.com/streamnative/pulsar/issues/1304

### Motivation

Currently, the consumer can't receive transaction messages.

### Modifications

Support process the commit marker in the topic partition and fetch transaction messages from TransactionBuffer.
lbenc135 pushed a commit to lbenc135/pulsar that referenced this pull request Sep 5, 2020
Master Issue: apache#2664 

Fix https://github.com/streamnative/pulsar/issues/1304

### Motivation

Currently, the consumer can't receive transaction messages.

### Modifications

Support process the commit marker in the topic partition and fetch transaction messages from TransactionBuffer.
lbenc135 pushed a commit to lbenc135/pulsar that referenced this pull request Sep 5, 2020
Master Issue: apache#2664 

Fix https://github.com/streamnative/pulsar/issues/1304

### Motivation

Currently, the consumer can't receive transaction messages.

### Modifications

Support process the commit marker in the topic partition and fetch transaction messages from TransactionBuffer.
lbenc135 pushed a commit to lbenc135/pulsar that referenced this pull request Sep 5, 2020
Master Issue: apache#2664 

Fix https://github.com/streamnative/pulsar/issues/1304

### Motivation

Currently, the consumer can't receive transaction messages.

### Modifications

Support process the commit marker in the topic partition and fetch transaction messages from TransactionBuffer.
@gaoran10 gaoran10 mentioned this pull request Nov 21, 2020
32 tasks
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.

[Transaction] Consume transaction messages.
3 participants