sql: ensure that schema change backfill txns enforce deadline imposed by table descriptor leases
This is a placeholder issue that involves some audit work to check if the transactions run by schema change backfill enforce the deadlines required by the table leases held during the transactions.
The work here involves passing the expiration time in the backfill processor protobuf and adding the expiration time as a deadline for all backfill transactions.
@ajwerner We were talking about long-running schema change backfills and table leases the other day. Is this issue still useful at all?
@ajwerner We were talking about long-running schema change backfills and table leases the other day. Is this issue still useful at all?
Good question. On the one hand I'd hope that we reject committing transactions which would invalidate any of the writes by a running backfill. I suspect there is some validity to keeping this open and reflecting on it.
I don't think Vivek's comment is particularly sound anymore. Ideally we'd instead have the backfill maintain its own leases and use them for each transaction. I think we should retain this one in a backlog until we better understand it.
Upon further reflection I don't think this makes sense. I checked the code-paths and we do have the proper expiration set for each backfill chunk. See https://github.com/cockroachdb/cockroach/blob/d7761ab0587e4b75131f8ffbbc1d3eb2aecca028/pkg/sql/backfill.go#L654 which you can follow down to https://github.com/cockroachdb/cockroach/blob/d7761ab0587e4b75131f8ffbbc1d3eb2aecca028/pkg/sql/catalog/descs/collection.go#L402
If there is a problem here, maybe we'll dig this up in the archeology.