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

[improve] [txn] [PIP-160] Protocol changes and configuration changes for transaction batch log #16617

Merged
merged 7 commits into from
Jul 17, 2022

Conversation

poorbarcode
Copy link
Contributor

@poorbarcode poorbarcode commented Jul 15, 2022

Master Issue: #15370

Motivation

see #15370

Modifications

I will complete proposal #15370 with these pull requests( current pull request is the step-2 ):

  1. Write the batch transaction log handler: TxnLogBufferedWriter
  2. Configuration changes and protocol changes.
  3. Transaction log store enables the batch feature.
  4. Pending ack log store enables the batch feature.
  5. Supports dynamic configuration.
  6. Append admin API for transaction batch log and docs( admin and configuration doc ).
  7. Append metrics support for transaction batch log.

Documentation

  • doc-required

  • doc-not-needed

  • doc

  • doc-complete

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Jul 15, 2022
@poorbarcode
Copy link
Contributor Author

@liangyepianzhou @congbobo184 @codelipenghui Could you take a look, please?

@congbobo184 congbobo184 self-assigned this Jul 15, 2022
@congbobo184 congbobo184 added doc-required Your PR changes impact docs and you will update later. area/transaction type/feature The PR added a new feature or issue requested a new feature and removed doc-not-needed Your PR changes do not impact docs labels Jul 15, 2022
@congbobo184 congbobo184 added this to the 2.11.0 milestone Jul 15, 2022
Copy link
Contributor

@codelipenghui codelipenghui left a comment

Choose a reason for hiding this comment

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

Please add an unit test to make sure the configuration is really work and make sure the default value is expected.

conf/broker.conf Outdated
transactionLogBatchedWriteMaxRecords= 512;
# If enabled the feature that transaction log batch, this attribute means bytes size in a batch.
transactionLogBatchedWriteMaxSize= 1024 * 1024 * 4;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can't user 1024 * 1024 * 4 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.

Already fixed.

conf/broker.conf Outdated
# persist into a single BK entry. This will make Pulsar transactions work more efficiently, aka batched log.
# see: https://github.com/apache/pulsar/issues/15370
transactionLogBatchedWriteEnabled = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
transactionLogBatchedWriteEnabled = false;
transactionLogBatchedWriteEnabled=false;

Please check all.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Already fixed.

@codelipenghui
Copy link
Contributor

@poorbarcode Please update the PR title as the PR really changed.

conf/broker.conf Outdated
Comment on lines 1540 to 1562
# persist into a single BK entry. This will make Pulsar transactions work more efficiently, aka batched log.
# see: https://github.com/apache/pulsar/issues/15370
transactionLogBatchedWriteEnabled = false;
# If enabled the feature that transaction log batch, this attribute means maximum log records count in a batch.
transactionLogBatchedWriteMaxRecords= 512;
# If enabled the feature that transaction log batch, this attribute means bytes size in a batch.
transactionLogBatchedWriteMaxSize= 1024 * 1024 * 4;
# If enabled the feature that transaction log batch, this attribute means maximum wait time(in millis) for the first
# record in a batch
transactionLogBatchedWriteMaxDelayInMillis= 1;
# Provide a mechanism allowing the Pending Ack Store to aggregate multiple records into a batched record and persist
# into a single BK entry. This will make Pulsar transactions work more efficiently, aka batched log.
# see: https://github.com/apache/pulsar/issues/15370
transactionPendingAckBatchedWriteEnabled = false;
# If enabled the feature that transaction pending ack log batch, this attribute means maximum log records count in a
# batch.
transactionPendingAckBatchedWriteMaxRecords= 512;
# If enabled the feature that transaction pending ack log batch, this attribute means bytes size in a batch.
transactionPendingAckBatchedWriteMaxSize= 1024 * 1024 * 4;
# If enabled the feature that transaction pending ack log batch, this attribute means maximum wait time(in millis) for
# the first record in a batch.
transactionPendingAckBatchedWriteMaxDelayInMillis= 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

move to
under

### --- Transaction config variables --- ###

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Already fixed.

@poorbarcode poorbarcode changed the title [improve] [txn] [PIP-160] Make transactions work more efficiently by aggregation operation for transaction log and pending ack store [improve] [txn] [PIP-160] Protocol changes and Configuration changes for transaction batch log Jul 15, 2022
@poorbarcode
Copy link
Contributor Author

@poorbarcode Please update the PR title as the PR really changed.

Already Fixed.

@poorbarcode poorbarcode changed the title [improve] [txn] [PIP-160] Protocol changes and Configuration changes for transaction batch log [improve] [txn] [PIP-160] Protocol changes and configuration changes for transaction batch log Jul 15, 2022
@poorbarcode
Copy link
Contributor Author

poorbarcode commented Jul 15, 2022

Please add an unit test to make sure the configuration is really work and make sure the default value is expected.

@codelipenghui Thanks much. This is a good way to solve the errors caused by carelessness.

Already fixed.

Copy link
Contributor

@liangyepianzhou liangyepianzhou left a comment

Choose a reason for hiding this comment

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

Good work! Leave a few comments.

@FieldContext(
category = CATEGORY_SERVER,
doc = "If enabled the feature that transaction log batch, this attribute means maximum wait time(in millis)"
+ " for the first record in a batch, default 1."
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
+ " for the first record in a batch, default 1."
+ " for the first record in a batch, default 1 millisecond."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Already fixed.

@FieldContext(
category = CATEGORY_SERVER,
doc = "If enabled the feature that transaction pending ack log batch, this attribute means maximum wait"
+ " time(in millis) for the first record in a batch, default 1."
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
+ " time(in millis) for the first record in a batch, default 1."
+ " time(in millisecond) for the first record in a batch, default 1 millisecond."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Already fixed.

Copy link
Member

@mattisonchao mattisonchao left a comment

Choose a reason for hiding this comment

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

LGTM,
Another question: Should we add this configuration in standalone.conf?

@poorbarcode
Copy link
Contributor Author

LGTM, Another question: Should we add this configuration in standalone.conf?

Already fixed. Thanks

@poorbarcode
Copy link
Contributor Author

/pulsarbot run-failure-checks

@liangyepianzhou liangyepianzhou merged commit ee35de6 into apache:master Jul 17, 2022
@poorbarcode poorbarcode deleted the pip/160-3 branch July 17, 2022 13:25
@momo-jun
Copy link
Contributor

momo-jun commented Jul 19, 2022

Doc status update

@poorbarcode has updated relevant docs in a follow-up PR #16764.
The doc label can be refreshed. @Anonymitaet

@Anonymitaet Anonymitaet added doc-complete Your PR changes impact docs and the related docs have been already added. and removed doc-required Your PR changes impact docs and you will update later. labels Jul 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/transaction doc-complete Your PR changes impact docs and the related docs have been already added. type/feature The PR added a new feature or issue requested a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants