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

tso: eliminate unnecessary abstractions in the allocator #9158

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

JmPotato
Copy link
Member

What problem does this PR solve?

Issue Number: ref #8802.

What is changed and how does it work?

This commit refactors the TSO allocator components to simplify the architecture:

1. Removed the unnecessary `allocatorGroup` abstraction and its related operations
2. Simplified the relationship between `AllocatorManager` and `GlobalTSOAllocator`
3. Renamed internal methods to be more consistent with their accessibility levels
4. Removed unused code like `AllocatorGroupFilter` and consolidated configuration handling
5. Eliminated the general `Allocator` interface in favor of direct use of `GlobalTSOAllocator`
6. Made the TSO allocator loop more straightforward by removing nested function calls

The refactoring maintains all functionality while making the code more maintainable with fewer abstraction layers.

Check List

Tests

  • Unit test
  • Integration test

Release note

None.

@JmPotato JmPotato added the component/tso Timestamp Oracle. label Mar 19, 2025
@JmPotato JmPotato requested review from lhy1024, okJiang and rleungx March 19, 2025 08:16
@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has signed the dco. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Mar 19, 2025
@JmPotato JmPotato force-pushed the simplify_allocator_mgr branch from 76b222b to d945728 Compare March 19, 2025 09:17
Copy link

codecov bot commented Mar 19, 2025

Codecov Report

Attention: Patch coverage is 96.26168% with 4 lines in your changes missing coverage. Please review.

Project coverage is 76.32%. Comparing base (e8050f7) to head (d945728).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9158      +/-   ##
==========================================
- Coverage   76.37%   76.32%   -0.06%     
==========================================
  Files         474      474              
  Lines       72400    72339      -61     
==========================================
- Hits        55297    55211      -86     
- Misses      13644    13668      +24     
- Partials     3459     3460       +1     
Flag Coverage Δ
unittests 76.32% <96.26%> (∅)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@okJiang okJiang left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Mar 20, 2025
Copy link
Contributor

ti-chi-bot bot commented Mar 20, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-03-20 07:41:04.055260703 +0000 UTC m=+514157.739496800: ☑️ agreed by okJiang.

Copy link
Contributor

ti-chi-bot bot commented Mar 20, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: okJiang
Once this PR has been reviewed and has the lgtm label, please ask for approval from jmpotato, ensuring that each of them provides their approval before proceeding. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/tso Timestamp Oracle. dco-signoff: yes Indicates the PR's author has signed the dco. needs-1-more-lgtm Indicates a PR needs 1 more LGTM. release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants