-
Notifications
You must be signed in to change notification settings - Fork 61
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
[RHCLOUD-38531] Add function to populate workspaces #1579
Conversation
|
||
def batch_import_workspace(records): | ||
"""Import workspace records in batch.""" | ||
with transaction.atomic(): |
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.
@astrozzc is this ok or should we put everything in one transaction ? if it will fails I guess batch import workspace
method is idempotent ?
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.
If we put everything in one transaction, the performance would be worse because the data is too large. Batched transaction should be enough.
Right, if we run again, it is supposed to be idempotent
rbac/management/tenant_service/v2.py
Outdated
relationships.append(relationship) | ||
self._replicator.replicate( | ||
ReplicationEvent( | ||
event_type=ReplicationEventType.BOOTSTRAP_TENANT, |
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.
maybe different type ?
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 catch!
ee2ebc3
to
07aee47
Compare
Link(s) to Jira
Description of Intent of Change(s)
Add the function to import data
Local Testing
Unit tests
Checklist
Secure Coding Practices Checklist Link
Secure Coding Practices Checklist