Skip to content

Commit

Permalink
BABEL: Handling babelfish specific GUC after commit a1a00b3 (babelfis…
Browse files Browse the repository at this point in the history
…h-for-postgresql#290)

With commit a1a00b3, community refactored the code related to GUC handling
and introduced certain optimisation around GUC handling. For example, they have introduced following three fields for various purpose --

static dlist_head guc_nondef_list;	/* list of variables that have source
									 * different from PGC_S_DEFAULT */
static slist_head guc_stack_list;	/* list of variables that have non-NULL
									 * stack */
static slist_head guc_report_list;	/* list of variables that have the
									 * GUC_NEEDS_REPORT bit set in status */

These all fields are getting updated based on various operations on the GUC. Field guc_nondef_list is to track non-default
value of various GUCs and is updated through helper function set_guc_source(...). Now the logic of Babelfish GUC
handling is somewhat different and was not updated to accommodate these code changes. This resulted in hang while
communicating GUCs with non-default value to parallel worker.

This commit aims to fix that issue by providing wrapper around set_guc_source(...) so that Babelfish side can utilise it to
update the guc_nondef_list stack appropriately.

Extension PR: babelfish-for-postgresql/babelfish_extensions#2244
Task: BABEL-4668, BABEL-4669, BABEL-4670, BABEL-4671
Signed-off-by: Dipesh Dhameliya <[email protected]>
  • Loading branch information
Deepesh125 authored and roshan0708 committed Oct 18, 2024
1 parent fdf6ab1 commit b8c0cfe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/backend/utils/misc/guc.c
Original file line number Diff line number Diff line change
Expand Up @@ -6808,3 +6808,9 @@ guc_set_stack_value(struct config_generic *gconf, config_var_value *val)
{
set_stack_value(gconf, val);
}

void
babelfish_set_guc_source(struct config_generic *gconf, GucSource newsource)
{
set_guc_source(gconf, newsource);
}
2 changes: 2 additions & 0 deletions src/include/utils/guc_tables.h
Original file line number Diff line number Diff line change
Expand Up @@ -320,4 +320,6 @@ extern PGDLLEXPORT guc_push_old_value_hook_type guc_push_old_value_hook;
typedef void(*validate_set_config_function_hook_type) (char *name, char *value);
extern PGDLLEXPORT validate_set_config_function_hook_type validate_set_config_function_hook;

extern void babelfish_set_guc_source(struct config_generic *gconf, GucSource newsource);

#endif /* GUC_TABLES_H */

0 comments on commit b8c0cfe

Please sign in to comment.