Skip to content

[Transaction] Fix MLTransactionLog open manageLedger name problem. - #10334

Merged
codelipenghui merged 2 commits into
apache:masterfrom
congbobo184:congbobo184_fix_tc_persistent_name_problem
Apr 23, 2021
Merged

[Transaction] Fix MLTransactionLog open manageLedger name problem.#10334
codelipenghui merged 2 commits into
apache:masterfrom
congbobo184:congbobo184_fix_tc_persistent_name_problem

Conversation

@congbobo184

Copy link
Copy Markdown
Contributor

Motivation

now MLTransactionLog generate managedLedger name is illegal.

implement

generate correct name and can generate metrics.

Verifying this change

Add the tests for it

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: (no)
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)

@eolivelli eolivelli 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.

Awesome.
I left some minor comments

&& !checkTopicIsEventsNames(topic)
&& !topic.contains(TopicName.TRANSACTION_COORDINATOR_ASSIGN.getLocalName())) {
&& !topic.contains(TopicName.TRANSACTION_COORDINATOR_ASSIGN.getLocalName())
&& !topic.contains(MLTransactionLogImpl.TRANSACTION_LOG_PREFIX)) {

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.

Can we use startsWith ?

managedLedgerConfig.setMaxEntriesPerLedger(2);
new MLTransactionLogImpl(TransactionCoordinatorID.get(0),
pulsar.getManagedLedgerFactory(), managedLedgerConfig);
Thread.sleep(2000);

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.

Why do you need this sleep? Can we replace with Awaiatility in order to make the test more resilient?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

don't need sleep, I did not check again.

@eolivelli eolivelli 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.

Lgtm

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.

4 participants