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

Restore lost data for orgs inherited from org1 #668

Closed
mahalakshme opened this issue Dec 14, 2023 · 5 comments
Closed

Restore lost data for orgs inherited from org1 #668

mahalakshme opened this issue Dec 14, 2023 · 5 comments
Assignees

Comments

@mahalakshme
Copy link
Contributor

mahalakshme commented Dec 14, 2023

  • Restore parent concepts from prerelease or latest backup if any available
  • Issue has occurred as part of release 5.1.2 which was done before November 30
@mahalakshme mahalakshme transferred this issue from avniproject/avni-client Dec 14, 2023
@petmongrels
Copy link
Contributor

@himeshr
Copy link
Contributor

himeshr commented Dec 18, 2023

Regarding the update of lastModifiedDateTime values, such as the following assignment:

last_modified_date_time = current_timestamp + (interval '1 millisecond'/100)

present in
https://github.com/avniproject/data-fixes/blob/3da55337f76ba7934e483cd45ea9cf1df8ec4f09/ck-ihmp-data-loss/ck/fix.sql#L10

https://github.com/avniproject/data-fixes/blob/3da55337f76ba7934e483cd45ea9cf1df8ec4f09/ck-ihmp-data-loss/ihmp/fix.sql#L20

Since 'current_timestamp' value remains fixed for all sql commands within a single transaction, we should also have made use of entity "id" value to ensure that the timestamps are slightly different for each entity to avoid skipping entities during sync fetch.

last_modified_date_time = current_timestamp + (id * (interval '1 millisecond'/100))

@himeshr
Copy link
Contributor

himeshr commented Dec 18, 2023

This would only ever be a partial restore of the data to a version available for the data of recovery. Rest of the data has to be reworked on by the organisations.

Apart from data fix done as part of this card, @mahalakshme, @petmongrels and @vinayvenu are there some additional checks we could put in place to avoid these issues in future.

@himeshr
Copy link
Contributor

himeshr commented Dec 18, 2023

This would only ever be a partial restore of the data to a version available for the data of recovery. Rest of the data has to be reworked on by the organisations.

Apart from data fix done as part of this card, @mahalakshme, @petmongrels and @vinayvenu are there some additional checks we could put in place to avoid these issues in future.

After discussion, came to know of NPE being thrown in case Concept is not found during save of an Entity with observations.
This would avoid these kind of issues in future.

@mahalakshme
Copy link
Contributor Author

@himeshr @vinayvenu Once this(data recovery and data to be collected is sent) is done, also reply to the corresponding tickets:
https://avni.freshdesk.com/a/tickets/3323 : avniproject/avni-product#1446
https://avni.freshdesk.com/a/tickets/3326 : avniproject/avni-client#1220

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

4 participants