Skip to content

Rework gp_optimizer_functions.c to use runtime check of Orca's presence - #1126

Merged
whitehawk merged 6 commits into
feature/ADBDEV-6552from
ADBDEV-6624
Nov 25, 2024
Merged

Rework gp_optimizer_functions.c to use runtime check of Orca's presence#1126
whitehawk merged 6 commits into
feature/ADBDEV-6552from
ADBDEV-6624

Conversation

@whitehawk

@whitehawk whitehawk commented Nov 19, 2024

Copy link
Copy Markdown

Rework gp_optimizer_functions.c to use runtime check of Orca's presence

Problem:
Functions in gp_optimizer_functions.c had a compile-time dependency on Orca.
It introduced difficulties for moving Orca's functionality into a shared lib.

This patch:

  1. Moves implementation of 'DisableXform()', 'EnableXform()',
    'LibraryVersion()' into gp_orca shared lib.
  2. Updates implementation of wrapper functions 'enable_xform()',
    'disable_xform()', 'gp_opt_version()'. Now they try to load the underlying
    functions from a shared lib. Attempt to load a symbol from a shared lib is
    wrapped into PG_TRY & PG_CATCH (with all necessary shenanigans), as the lib may
    be missing. In this case we catch the error, and show an appropriate message.
  3. Updates tests due to change of the message if Orca is not enabled.

Note: we do not move the wrapper's implementation into gp_orca extension, as
they are already a part of the system catalog. And we'd like to avoid changing
the system catalog.

@whitehawk whitehawk changed the title Rework gp_optimizer functions to use runtime check of Orca's presence Rework gp_optimizer_functions.c to use runtime check of Orca's presence Nov 19, 2024
@whitehawk
whitehawk marked this pull request as ready for review November 19, 2024 00:43
Comment thread src/backend/utils/adt/gp_optimizer_functions.c
Comment thread src/backend/utils/adt/gp_optimizer_functions.c Outdated
Comment thread src/backend/utils/adt/gp_optimizer_functions.c
Comment thread src/backend/utils/adt/gp_optimizer_functions.c Outdated
Comment thread src/backend/utils/adt/gp_optimizer_functions.c Outdated
@RekGRpth

This comment was marked as resolved.

Comment thread src/backend/utils/adt/gp_optimizer_functions.c Outdated
@whitehawk

Copy link
Copy Markdown
Author
  1. and show a message as it was
    before, when GPDB was compiled without Orca.

may be update this?

done

Comment thread src/backend/utils/adt/gp_optimizer_functions.c
@whitehawk
whitehawk merged commit 927afa0 into feature/ADBDEV-6552 Nov 25, 2024
@whitehawk
whitehawk deleted the ADBDEV-6624 branch November 25, 2024 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants