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

refactor(meta): deprecate dispatcher table and compose dispatcher by fragment relation #20541

Merged
merged 1 commit into from
Feb 27, 2025

Conversation

wenym1
Copy link
Contributor

@wenym1 wenym1 commented Feb 19, 2025

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

With FragmentRelation table introduced, we don't have to persist the dispatcher information. Therefore, in this PR, we will deprecate the dispatcher table. In all places that used the dispatcher table, we will change to use the FragmentRelation table.

Previously, the dispatcher is used in either resolving the logical connection between fragments, or loading the existing physical dispatchers. For resolving the logical connection between fragments, we can use the FragmentRelation directly. For loading existing physical dispatchers, we can actually recompose the physical dispatchers by combining information in FragmentRelation table and the vnode distribution of upstream and downstream actors.

Checklist

  • I have written necessary rustdoc comments.
  • I have added necessary unit tests and integration tests.
  • I have added test labels as necessary.
  • I have added fuzzing tests or opened an issue to track them.
  • My PR contains breaking changes.
  • My PR changes performance-critical code, so I will run (micro) benchmarks and present the results.
  • My PR contains critical fixes that are necessary to be merged into the latest release.

Documentation

  • My PR needs documentation updates.
Release note

@wenym1 wenym1 force-pushed the yiming/deprecate-persisted-actor-dispatcher branch 3 times, most recently from 6643525 to 878575c Compare February 19, 2025 15:02
Base automatically changed from yiming/deprecate-persisted-actor-upstreams to main February 20, 2025 08:40
@wenym1 wenym1 force-pushed the yiming/deprecate-persisted-actor-dispatcher branch 2 times, most recently from f524b43 to cfd4e73 Compare February 20, 2025 08:54
@wenym1 wenym1 force-pushed the yiming/deprecate-persisted-actor-dispatcher branch from cfd4e73 to 48b2492 Compare February 20, 2025 10:53
@wenym1 wenym1 force-pushed the yiming/deprecate-persisted-actor-dispatcher branch 3 times, most recently from 58a91ac to 6889cce Compare February 25, 2025 10:07
@wenym1 wenym1 force-pushed the yiming/deprecate-persisted-actor-dispatcher branch from 6889cce to 533e6fe Compare February 27, 2025 07:03
Copy link
Member

@yezizp2012 yezizp2012 left a comment

Choose a reason for hiding this comment

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

Rest LGTM

@@ -57,79 +55,3 @@ impl From<DispatcherType> for PbDispatcherType {
}
}
}

Copy link
Member

Choose a reason for hiding this comment

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

Can we create a migration to drop the table and also remove this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Shall we keep the dispatcher table for a release? The backfill of fragment_relation depends on the dispatcher table. I'm afraid that if something wrong happened after we drop the dispatcher table and the fragment_relation table gets rollbacked and also dropped in the down, then we will lose the dispatcher information forever and cannot backfill the fragment_relation table.

Copy link
Member

@yezizp2012 yezizp2012 Feb 27, 2025

Choose a reason for hiding this comment

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

I'm afraid that if something wrong happened after we drop the dispatcher table and the fragment_relation table gets rollbacked and also dropped in the down

🤔 The backfill of fragment_relation is done in previous migration m20250106_072104_fragment_relation.rs, if it fails actor_dispatcher won't be dropped. Actually the logic of "down" is mostly untrustworthy and irreversible, we will not execute it or rely on it to perform a downgrade. Currently, the only consistency that can be guaranteed in rw is backup and restore. The only issue I can think of is that fragment_relation is not included in the backup, which has been fixed in this PR.

It's fine to keep it for now, as it doesn't have any negative effects and aids in recovering abnormal data and pinpointing issues. Shall we leave a TODO for it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. I will create an issue to track it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@wenym1 wenym1 added this pull request to the merge queue Feb 27, 2025
Merged via the queue into main with commit 5c54c46 Feb 27, 2025
31 of 33 checks passed
@wenym1 wenym1 deleted the yiming/deprecate-persisted-actor-dispatcher branch February 27, 2025 09:04
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.

3 participants