Skip to content

Commit

Permalink
[#22061] yugabyted: Remove pg parity related gflags from allowed_prev…
Browse files Browse the repository at this point in the history
…iew_flags_csv.

Summary:
`yb_enable_read_committed_isolation` and `ysql_enable_read_request_caching` were included as part of `allowed_preview_flags_csv` because of which these flags were not getting set properly. In this diff, we are removing it as a part of `allowed_preview_flags_csv` and directly enabling it on the `yb-master` and `yb-tserver` processes.
Jira: DB-10983

Test Plan: Manual Testing

Reviewers: nikhil

Reviewed By: nikhil

Subscribers: yugabyted-dev, shikhar.sahay

Differential Revision: https://phorge.dev.yugabyte.com/D34319
  • Loading branch information
ShikharSahay committed Apr 19, 2024
1 parent 3051ba8 commit 225247a
Showing 1 changed file with 41 additions and 3 deletions.
44 changes: 41 additions & 3 deletions bin/yugabyted
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,11 @@ METRICS_SNAPSHOT_LIST = [
"handler_latency_yb_tserver_TabletServerService_Write_sum",
"disk_usage", "cpu_usage", "node_up"
]
PG_PARITY_FLAGS_LIST = [
"yb_enable_read_committed_isolation=true",
"ysql_enable_read_request_caching=true"
]
PG_PARITY_FLAGS_DICT = {
"allowed_preview_flags_csv": "yb_enable_read_committed_isolation=true,"
"ysql_enable_read_request_caching=true",

"ysql_pg_conf_csv": "yb_enable_base_scans_cost_model=true,"
"yb_enable_optimizer_statistics=true,"
"yb_bnl_batch_size=1024,"
Expand Down Expand Up @@ -2823,6 +2824,26 @@ class ControlScript(object):

master_flags = self.configs.saved_data.get("master_flags","")

if self.configs.temp_data.get("enable_pg_parity"):
# Process simple flags from PG_PARITY_FLAGS_LIST
existing_flags = {}
current_flags = master_flags.split(',')
for flag in current_flags:
if '=' in flag:
key, value = flag.split('=', 1)
existing_flags[key] = value

for flag in PG_PARITY_FLAGS_LIST:
key = flag.split('=')[0]
if existing_flags.get(key) is None:
if master_flags and not master_flags.endswith(","):
master_flags += ","
# Add the missing flag to the master flags
master_flags += flag

# Update the master_flags in self.configs.saved_data with pg_parity flags
self.configs.saved_data["master_flags"] = master_flags

# if a join ip is specified, bring up a shell mode master
if not join_ip:
yb_master_cmd.append("--master_addresses={}".format(master_addresses))
Expand Down Expand Up @@ -2905,6 +2926,23 @@ class ControlScript(object):
tserver_flags = self.configs.saved_data.get("tserver_flags","")

if self.configs.temp_data.get("enable_pg_parity"):
# Process simple flags from PG_PARITY_FLAGS_LIST
existing_flags = {}
current_flags = tserver_flags.split(',')
for flag in current_flags:
if '=' in flag:
key, value = flag.split('=', 1)
existing_flags[key] = value

for flag in PG_PARITY_FLAGS_LIST:
key = flag.split('=')[0]
if existing_flags.get(key) is None:
if tserver_flags and not tserver_flags.endswith(","):
tserver_flags += ","
# Add the missing flag to the tserver flags
tserver_flags += flag

# Process CSV flags from PG_PARITY_FLAGS_DICT
for pg_parity_flag, pg_parity_flag_values in PG_PARITY_FLAGS_DICT.items():
# If pg_parity_flag present in tserver_flags
# Extract the value and append any default missing pg_parity_flag_values
Expand Down

0 comments on commit 225247a

Please sign in to comment.