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

feat(duplication): add a new RPC to list duplications for one or multiple tables with specified pattern #2164

Merged
merged 14 commits into from
Dec 6, 2024

Conversation

empiredan
Copy link
Contributor

@empiredan empiredan commented Dec 4, 2024

Currently the only query API is used for just one table. However, sometimes
we need to query duplications for more than one tables by just a name pattern
(prefix, postfix, regex, etc.). Even we just want to get all of the duplications of
all tables of the cluster, without giving a specific table name. For example, while
migrating all tables to another cluster, we want to query the progress of all the
tables at any time; or, we just care about the tables of one database(with the
prefix of table name as the database name).

Therefore, a new RPC is added to allow listing duplication info of tables whose
names are given by some pattern, such as prefix, postfix, regex(would be
supported in the future), exactly match or even all tables of the cluster.

@empiredan empiredan changed the title feat(duplication): add a new RPC to list duplications for one or multiple tabls feat(duplication): add a new RPC to list duplications for one or multiple tables Dec 5, 2024
@empiredan empiredan marked this pull request as ready for review December 5, 2024 13:33
@empiredan empiredan added the component/duplication cluster duplication label Dec 5, 2024
idl/utils.thrift Outdated Show resolved Hide resolved
@@ -62,6 +73,10 @@ bool iequals(const char *lhs, const std::string &rhs, size_t n);
// Decide whether the first n bytes of two memory areas are equal, even if one of them is NULL.
bool mequals(const void *lhs, const void *rhs, size_t n);

error_code pattern_match(const std::string &str,
Copy link
Member

Choose a reason for hiding this comment

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

There is a similar implementation in bool pegasus_server_impl::validate_filter(...), is it possible to unify to use 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.

OK, seems similar. I've added a TODO comment for this. And corner cases would also be checked later in case some errors occurred.

@empiredan empiredan changed the title feat(duplication): add a new RPC to list duplications for one or multiple tables feat(duplication): add a new RPC to list duplications for one or multiple tables with specified pattern Dec 6, 2024
@empiredan empiredan merged commit db13635 into apache:master Dec 6, 2024
98 of 100 checks passed
empiredan added a commit that referenced this pull request Dec 12, 2024
…r one or multiple tables (#2165)

Based on #2164, this PR is to
introduce a new command for Pegasus shell to list the duplications for one or
multiple tables of this cluster according to provided table name pattern.

This command could list table-level, duplication-level and partition-level info for each
duplication. It could also provide summary stats for listed duplications. It could check
the progress, which is useful while we want to know if the duplication-based migrations
have been finished, or how many decrees have not been duplicated. The duplications
that have not been finished could also be listed.
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