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

Handle NumberFormatException in debezium while updating sequence max value for sequence on non-integer column #2360

Merged
merged 3 commits into from
Mar 3, 2025

Conversation

priyanshi-yb
Copy link
Contributor

Describe the changes in this pull request

Skipping the max value update for sequences that are non-Integer columns in debezium.

fixes - https://yugabyte.atlassian.net/browse/DB-15398

Describe if there are any user-facing changes

No

How was this pull request tested?

Added an offline test for PG

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 26, 2025 05:56
sequenceMax.put(seqName, Math.max(sequenceMax.get(seqName), columnValue));
} catch (NumberFormatException e) {
//Skipping the sequences that are not on Integer columns
LOGGER.info("Skipping unsupported sequence with non-interger value: '{}'", seqName);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Perhaps DEBUG would be better? otherwise this would come up for every single row.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm, okay

columnValue = Long.valueOf(value);
sequenceMax.put(seqName, Math.max(sequenceMax.get(seqName), columnValue));
} catch (NumberFormatException e) {
//Skipping the sequences that are not on Integer columns
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you add more context in the comment on the type of sequences and why they could fail with a NumberFormatException?

@@ -214,4 +214,39 @@ WITH region_list AS (
amount[1 + mod(n, array_length(amount, 1))],
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this test already running in live migration & offline with BETA_FAST_DATA_EXPORT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only Offline with Beta_fast mode, we don't run pg_sequences test for live-migration currently

@priyanshi-yb priyanshi-yb merged commit 7da25cc into main Mar 3, 2025
66 checks passed
@priyanshi-yb priyanshi-yb deleted the priyanshi/fix-number-exception-dbzm branch March 3, 2025 07:07
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