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

reset problem with shofco syncs #120

Closed
siddhant3030 opened this issue Feb 24, 2025 · 7 comments
Closed

reset problem with shofco syncs #120

siddhant3030 opened this issue Feb 24, 2025 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@siddhant3030
Copy link
Collaborator

siddhant3030 commented Feb 24, 2025

Describe the bug
We've some missing data from commcare and we created a new sync to test this. New sync which we just created pulled

  1. zzz_case - we have these many records - 73,697 loaded (test connection ) - Test commcare gender (connection name)
  2. zzz_case - after reset in the main connection - 34,394 loaded - (Gender - Commcare)

both is using the same source. but one is pulling only few record after reset.

@fatchat fatchat transferred this issue from DalgoT4D/webapp Feb 24, 2025
@fatchat fatchat moved this to Ready in Dalgo 2025 Feb 24, 2025
@fatchat fatchat self-assigned this Feb 24, 2025
@fatchat fatchat added the bug Something isn't working label Feb 24, 2025
@fatchat fatchat moved this from Ready to In progress in Dalgo 2025 Feb 24, 2025
@fatchat
Copy link

fatchat commented Feb 24, 2025

In [8]: wclient.execute("select count (distinct id) from staging_gender.zzz_case ")
Out[8]: [{'count': 34394}]

In [9]: wclient.execute("select count (distinct id) from staging_gender_test.zzz_case ")
Out[9]: [{'count': 73697}]

Important: This command can only be run by one of the repository admins:
Usage: ./tools/bin/get_repo_admins.sh <personal_access_token>

@fatchat
Copy link

fatchat commented Feb 24, 2025

created new connection to an E2E Testing destination: 73,780 loaded

Important: This command can only be run by one of the repository admins:
Usage: ./tools/bin/get_repo_admins.sh <personal_access_token>

@fatchat
Copy link

fatchat commented Feb 24, 2025

reset the old connection, synced 34,394

Important: This command can only be run by one of the repository admins:
Usage: ./tools/bin/get_repo_admins.sh <personal_access_token>

@fatchat
Copy link

fatchat commented Feb 24, 2025

note that even though the new connections went from 73,697 to 73,780 after an hour or so had passed, the original connection is stuck at 34,394

Important: This command can only be run by one of the repository admins:
Usage: ./tools/bin/get_repo_admins.sh <personal_access_token>

@fatchat
Copy link

fatchat commented Feb 24, 2025

inspecting the catalog

SELECT id, catalog FROM public.connection
where id in ('f70ff943-9c4c-4dd6-b459-ff6993022605', '96bbe77d-64d8-4687-bbc2-7c82001523d4')

the catalog contains a list of 39 streams

the index of zzz_case in the original connection's catalog is 30
the index of zzz_case in the new connection's catalog is 38 i.e. last place

In the connector's Python code we have Form.read_records populating CommcareStream.forms

and Case.read_records refers to this list to decide whether or not to create a new record (if any(f in CommcareStream.forms for f in record["xform_ids"]))

So Case.read_records needs to run after all the Form.read_records run

And these streams are probably run in the order in which they appear in the catalog

Attempt: replace the old connection's catalog with the new connection's catalog (could have just moved the object for zzz_case to the end but there are some new keys like is_resumable so may as well get those in there

Cleared and syncing

Important: This command can only be run by one of the repository admins:
Usage: ./tools/bin/get_repo_admins.sh <personal_access_token>

@fatchat
Copy link

fatchat commented Feb 24, 2025

yes that fixed it
73,780 records

Important: This command can only be run by one of the repository admins:
Usage: ./tools/bin/get_repo_admins.sh <personal_access_token>

@fatchat
Copy link

fatchat commented Feb 24, 2025

long-term fix will be done via #121

Important: This command can only be run by one of the repository admins:
Usage: ./tools/bin/get_repo_admins.sh <personal_access_token>

@fatchat fatchat closed this as completed Feb 24, 2025
@github-project-automation github-project-automation bot moved this from In progress to Done in Dalgo 2025 Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

2 participants