Skip to content
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

Do not check for enabled triggers / FKs for fallback workflow of PG if session_replication_role session variable is used #2322

Merged
merged 4 commits into from
Feb 20, 2025

Conversation

priyanshi-yb
Copy link
Contributor

@priyanshi-yb priyanshi-yb commented Feb 14, 2025

Describe the changes in this pull request

  1. Adding GRANT SQL for granting the SET on session_replication_role to source-db-user to utilize it in Fallback case for import data to source
  2. Added a check in GetEnabledTriggersAndFks(), to not fetch the triggers/Fks in case this session parameter is used.

Describe if there are any user-facing changes

Yes, new grant is added in script and guardrail check is fixed for handling the case where session_replication_role is used.

How was this pull request tested?

Manually

Does your PR have changes that can cause upgrade issues?

Component Breaking changes?
MetaDB No
Name registry json No
Data File Descriptor Json No
Export Snapshot Status Json No
Import Data State No
Export Status Json No
Data .sql files of tables No
Export and import data queue No
Schema Dump No
AssessmentDB No
Sizing DB No
Migration Assessment Report Json No
Callhome Json No
YugabyteD Tables No
TargetDB Metadata Tables No

@priyanshi-yb priyanshi-yb marked this pull request as ready for review February 17, 2025 09:40
@@ -115,6 +116,9 @@ func (pg *TargetPostgreSQL) Init() error {
if err != nil {
return err
}
if len(pg.tconf.SessionVars) == 0 {
pg.tconf.SessionVars = getYBSessionInitScript(pg.tconf)
Copy link
Collaborator

@makalaaneesh makalaaneesh Feb 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably use a different function/vars for this. PG and YB will have different set of session params? The function also does some YB specific stuff - for example checking in /etc/yb-voyager/ybSessionVariables.sql

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So other than the yb-enable-upsert session variable (which is run based on tconf.EnableUpsert), all are common for PG/YB so didn't feel the need right now but yeah we can have separate ones.

Copy link
Collaborator

@makalaaneesh makalaaneesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@priyanshi-yb priyanshi-yb merged commit fb10bbd into main Feb 20, 2025
66 checks passed
@priyanshi-yb priyanshi-yb deleted the priyanshi/fix-session-param-pg-fb branch February 20, 2025 11:05
shaharuk-yb pushed a commit that referenced this pull request Feb 27, 2025
…f session_replication_role session variable is used (#2322)

Adding GRANT SQL for granting the SET on session_replication_role to source-db-user to utilize it in Fallback case for import data to source
Added a check in GetEnabledTriggersAndFks(), to not fetch the triggers/Fks in case this session parameter is used.
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.

2 participants