Make Ci::ArchiveTraceWorker use replica for reads
This sets the data_consistency for the Ci::ArchiveTraceWorker to sticky. Allowing the read queries before any write to be handled by a replica.
The job is scheduled from the Ci::BuildFinishedWorker with some delay built in. Which means this job can take the 0.8s wait in the beginning, and is very likely to find a replica that is up to date with the WAL locations at the time of scheduling.
To increase the effect of this, this also preloads some associations in the worker. That way, we can take advantage of loading them from a replica rather than doing it lazily from the primary.
Edited by Bob Van Landuyt