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

Fix missing delta inserts of first-level children #493

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mstdokumaci
Copy link

When pgsync is catching up to changes via PG_NOTIFY or replication slots, it is missing inserts of first-level children. This commit is fixing the issue.

When pgsync is catching up to changes via PG_NOTIFY or replication slots, it is missing inserts of first-level children.
@mstdokumaci mstdokumaci changed the title Fix missing delta inserts of children Fix missing delta inserts of first-level children Sep 11, 2023
@dorin-musteata
Copy link

Hi, what is meant by first level children ?

Suppose I have a root table called product and categories which got a product_id reference. By first level children do we mean inserts on categories table ?

Asking because I have this model and indeed if insert is happening on categories, product document is not updated with new category.

@mstdokumaci
Copy link
Author

Hi, what is meant by first level children ?

Suppose I have a root table called product and categories which got a product_id reference. By first level children do we mean inserts on categories table ?

Asking because I have this model and indeed if insert is happening on categories, product document is not updated with new category.

yes, it only happens at first level children as you described and only on new inserts after pgsync has started. if you delete the checkpoint file and pgsync starts with a full sync, it will update all documents correctly.

@dorin-musteata
Copy link

Hi, what is meant by first level children ?
Suppose I have a root table called product and categories which got a product_id reference. By first level children do we mean inserts on categories table ?
Asking because I have this model and indeed if insert is happening on categories, product document is not updated with new category.

yes, it only happens at first level children as you described and only on new inserts after pgsync has started. if you delete the checkpoint file and pgsync starts with a full sync, it will update all documents correctly.

Doesn't seem to make a difference, if child record is inserted, parent document is not updated.

I tested it with one (product) to many (categories) relationship.

Maybe we are having two different issues, for which I have to open a bug ticket.

Thanks anyway 👍

@Ziming-W
Copy link

Ziming-W commented Jan 5, 2024

I encountered the same issue. But your commit doesn't seem to solve the problem for me. In my local pgsync library, I manually replaced the file you changed, the issue persists. Maybe I did it the wrong way?

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.

3 participants