-
-
Notifications
You must be signed in to change notification settings - Fork 217
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
SQLRepeatRecord #28952
SQLRepeatRecord #28952
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. ❤️ 1970-01-06 comment
So exciting to see this happening 🥇 I didn't read the code closely but had a comment on naming: are you planning on keeping the |
Good call! Do you think |
I think |
Urgh. I renamed it to RepeaterLink. I'm not sure it's an improvement, but I am sure I'm overthinking this. 😂 |
Let me join you in overthinking...I don't really love |
That is a good point. OK, I'll go with |
(I kinda prefer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
corehq/motech/repeaters/models.py
Outdated
""" | ||
return ( | ||
self.get_queryset() | ||
# Is not paused |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I think this comment is redundant with the code. I think you wanted to make this code more readable, you could add in some named variables instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooo! I like that idea! 2d8607d
1bac96f
to
761aba0
Compare
Should we really be dumping RepeatRecord and SQLRepeatRecord?
761aba0
to
85f8d7f
Compare
# NH (2021-01-08): Including SQLRepeatRecord because we dump (Couch) | ||
# RepeatRecord, but this does not seem like a good idea. | ||
FilteredModelIteratorBuilder('repeaters.SQLRepeatRecord', SimpleFilter('domain')), | ||
FilteredModelIteratorBuilder('repeaters.SQLRepeatRecordAttempt', SimpleFilter('repeat_record__domain')), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For 99% of domains, including repeat records with dumped domain data is insignificant, but for a handful it could be gigantic, with very little benefit. I suspect that in the future, (SQL) repeat records will be deleted automatically after six to twelve months anyway.
I'd love to hear opinions on this, especially if you have dealt with domain migrations. (@esoergel @snopoke ?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can certainly exclude all SQLRepeatRecordAttempt
objects. Is it possible to only include SQLRepeatRecord
objects that have not been successful yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. Yeah, we can filter by state
.
ping @dannyroberts for context |
Summary
These changes are guided by [CEP] Migrate RepeaterRecord to SQL.
This PR establishes the groundwork for using SQL for data forwarding. It only adds models; it does not change any behavior.
(I am creating this PR as a draft because its base branch is PR #28948. When that PR is merged, I'll switch this to a real PR.)
cc @calellowitz @orangejenny @millerdev @snopoke
Safety Assurance
Automated test coverage
Tests included in PR
QA Plan
Not yet applicable
Safety story
This PR does not change any behavior.
Rollback instructions