Use partition-aware preload for MergeTrains::Car

What does this MR do?

Opts MergeTrains::Car into the partition-aware pipeline preload framework (added in the base branch) so the merge train car list endpoints avoid cross-partition scans of p_ci_pipelines.

  • preload_api_entities scope (REST) opts into with_partition_aware_preload.
  • Train#persisted_cars extends the relation so the GraphQL CarsResolver list paths (all_active_cars_indexed, completed_cars) fire the hook via apply_lookahead.

Nested preloads under :pipeline (e.g. project: :route, namespace: :route) are preserved: the override loads :pipeline via available_records: and the trailing super re-descends into the children using the in-memory pipelines.

Gated behind the existing partition_aware_pipeline_preload feature flag (no new FF). FF-off behavior is the vanilla bulk preload (not N+1).

Part of #601100

Note

Stacked on top of mb/601100-bulk-pipeline-preloader-policy-schedule-pipeline (the framework branch); targets that branch and should merge after it.

Merge request reports

Loading