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

Restrict sync from big catchments #842

Open
mahalakshme opened this issue Dec 25, 2024 · 2 comments
Open

Restrict sync from big catchments #842

mahalakshme opened this issue Dec 25, 2024 · 2 comments

Comments

@mahalakshme
Copy link
Contributor

mahalakshme commented Dec 25, 2024

https://avni.freshdesk.com/a/tickets/5365

We are hitting the limits of number of parameters that can be passed to a prepared statement in Goonj.
When we are trying to get sync details on server, there are too many addresses in some catchment. This user has master catchment in Goonj.

all inheritors of org.avni.server.dao.SyncableRepository#isEntityChanged are likely impacted

They will also break the avni server

So should limit this.

@mahalakshme mahalakshme converted this from a draft issue Dec 25, 2024
@petmongrels
Copy link
Contributor

65,535 is the limit of number of prepared statement parameters supported by postgres in a single query. So to be on the same side we should keep it below 65,500 at least from correctness perspective.
org.avni.server.dao.SyncableRepository#isEntityChanged inheritors pass the addresses to postgres to query for changes.

@1t5j0y
Copy link
Contributor

1t5j0y commented Jan 31, 2025

we should also be able to use arrays or the 'any' operator instead of 'in' in the constructed query to work around the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Analysis
Development

No branches or pull requests

3 participants