-
Notifications
You must be signed in to change notification settings - Fork 312
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
Conversation
@@ -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, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
…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.
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.