mirror of
https://github.com/ansible/awx.git
synced 2026-05-12 03:47:36 -02:30
upgrade to partitions without a costly bulk data migration
keep pre-upgrade events in an old table (instead of a partition) - instead of creating a default partition, keep all events in special "unpartitioned" tables - track these tables via distinct proxy=true models - when generating the queryset for a UnifiedJob's events, look at the creation date of the job; if it's before the date of the migration, query on the old unpartitioned table, otherwise use the more modern table that provides auto-partitioning
This commit is contained in:
@@ -51,9 +51,9 @@ class InventoryUpdateEventsList(SubListAPIView):
|
||||
search_fields = ('stdout',)
|
||||
|
||||
def get_queryset(self):
|
||||
return super(InventoryUpdateEventsList, self).get_queryset().filter(
|
||||
job_created=self.get_parent_object().created_or_epoch
|
||||
)
|
||||
iu = self.get_parent_object()
|
||||
self.check_parent_access(iu)
|
||||
return iu.get_event_queryset()
|
||||
|
||||
def finalize_response(self, request, response, *args, **kwargs):
|
||||
response['X-UI-Max-Events'] = settings.MAX_UI_JOB_EVENTS
|
||||
|
||||
Reference in New Issue
Block a user