yugabyte / yugabyte-db

YugabyteDB - the cloud native distributed SQL database for mission-critical applications.
https://www.yugabyte.com
Other
8.75k stars 1.05k forks source link

ysql: fix uses of parser_ybc_beta_feature #10263

Open jaki opened 2 years ago

jaki commented 2 years ago

Jira Link: DB-1261 There are multiple issues with the individual beta feature flags. I believe the core issue is lack of understanding of parser_ybc_beta_feature. See the definition:

#define parser_ybc_beta_feature(pos, feature, has_own_flag) \
    check_beta_feature(pos, yyscanner, has_own_flag ? "FLAGS_ysql_beta_feature_" feature : NULL, feature)

If has_own_flag is true, there should be a corresponding flag declared, and feature should not have whitespace. It looks like this macro was used properly until commit a3c112233b621164d4367420c9db619aae7cf1c5. Bad uses include commit bc28a34342f94a0ee89391a98ccd1c174d5d0ba7 (my fault, cc: @robertsami) and 830ba9964031fbcbff9e1fb07cf8a215cfd7c7fa (PR #9650, cc: @fizaaluthra).

melvinxeu commented 2 years ago

Hello, I am new to open-source contribution and I am interested in your Yugabyte-db project. I would like to work on this issue.

jaki commented 2 years ago

Hi @melvinxeu. The main place to look is gram.y. Look for uses of parser_ybc_beta_features. If has_own_flag is true, check whether gflags are declared for them (search for DECLARE.*beta_feature_<feature> in codebase).

First thing you can do is investigate which flags have issues, and then we can decide whether to set has_own_flag false or create gflag for each of them.