pulsar icon indicating copy to clipboard operation
pulsar copied to clipboard

[cleanup][txn] Avoid unnessary method call if txn disabled.

Open lifepuzzlefun opened this issue 3 years ago • 3 comments

Fixes #18324

Motivation

avoid unnecessary method call if txn disabled.

Modifications

  1. remove isTxnEnabled parameter in TransactionBuffer.checkIfTransactionBufferRecoverCompletely.
  2. check isTxnEnabled before call txn related code in common code path.
  3. remove unused constructor of PersistentTopic

Verifying this change

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
  • [ ] Anything that affects deployment

Documentation

  • [ ] doc
  • [ ] doc-required
  • [x] doc-not-needed
  • [ ] doc-complete

lifepuzzlefun avatar Nov 03 '22 15:11 lifepuzzlefun

@WJL3333 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[bot] avatar Nov 03 '22 16:11 github-actions[bot]

@codelipenghui @congbobo184 please take a look, thank you~

lifepuzzlefun avatar Nov 03 '22 16:11 lifepuzzlefun

@congbobo184 Could you take a look?

poorbarcode avatar Nov 04 '22 08:11 poorbarcode

The pr had no activity for 30 days, mark with Stale label.

github-actions[bot] avatar Dec 08 '22 02:12 github-actions[bot]

Closed as stale. Also, code can be written in multiple styles. Such changes without a clear style rule are not converged. Generally, who write the functionality or fix a bug make the call on the style of his/her code snippet.

tisonkun avatar Dec 08 '22 10:12 tisonkun