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

[DSIP-32][Master] Add command fetcher strategy for master fetch command #15897

Closed
2 tasks done
Tracked by #14102
ruanwenjun opened this issue Apr 24, 2024 · 0 comments
Closed
2 tasks done
Tracked by #14102
Assignees

Comments

@ruanwenjun
Copy link
Member

ruanwenjun commented Apr 24, 2024

Search before asking

  • I had searched in the DSIP and found no similar DSIP.

Motivation

After 2.0, DS will pre-assign the command into master slot. If the master's currentSlotIndex = id % slotSize, then the command will be assign to the master.

image

This can work well then the command id is auto increment with step 1, but in some scenarios, the step is not 1, e.g. in distributed table, the step might be table size.
If the t_ds_command is exist in two database, and we want to make sure the id will not conflict, we might set the step be 2.

Then the id in one database will be 1,3,5,7,9. the commands will always assign to master-01.

image

Then the cluster will have single-point problems.

Design Detail

We need to import a CommandFetcher to fetch command. In this case, we will use BY_ID strategy can set the step to 2.

  command-fetch-strategy:
    type: ID_SLOT_BASED
    config:
      # The incremental id step
      id-step: 1
      # master fetch command num
      fetch-size: 10

the commands which (id / step) % slotSize = currentSlotIndex will be fetched by the CommandFetcher.

Compatibility, Deprecation, and Migration Plan

Compatibility with latest version

Test Plan

Test by UT and E2E

Code of Conduct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant