Closed saulius closed 11 years ago
My understanding is that Sequel.migration
blocks get run under a transaction (if the underlying data store supports that).
I don't think we have that with this task?
Yes, you are right. Wrapped into transaction. Hopefully we won't any kind of transaction buffer size limit with this.
If we have the transaction scope as a batch of 1000 rather than the whole job, that will presumably avoid the possibility of hitting any transaction size limit (or killing performance by building a massive in-memory transaction)?
Yes, that's safe to assume. What about state then, the job may finish in half-done state in case of an error. We can rerun it of course. Is that okay? If so I will move transaction into batch scope.
That sounds good. The operation is idempotent, which is always goodness.
It should run and affect lots of measures initially, then should do essentially nothing when run subsequently (unless we are importing new measures in this state, which is probably a bug).
Okay, I moved the transaction block.
Extracted lengthy migration to a task.