Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
105877: kvserver: fix trace span use-after-finish in apply pipeline r=erikgrinaker a=tbg Reported internally[^1]. It's possible for a proposal to be inserted into the proposal buffer just before it is applied, and to be flushed when it is applied. In this case, we would, in `propBuf.FlushLockedWithRaftGroup`, log to the trace span, which is a problem since that span got finished when the proposal got applied. While this crash happened under `useReproposalsV2==true`, I'm unsure why this would be a new problem with `useReproposalsV2`, and it doesn't seem to be particularly common either[^2]. However, I found a small gap in our handling of applied proposals, where one could actually show up in `FlushLockedWithRaftGroup` and explain this crash. I tightened the existing protections to drop the proposal before it reaches this point more reliably. Now we should no longer see this crash; if we did again, this would indicate a more serious problem in the trace span lifecycle. [^1]: https://cockroachlabs.slack.com/archives/C0KB9Q03D/p1688058044517609 [^2]: `./dev test --stress ./pkg/ccl/changefeedccl/ --filter TestChangefeedExactlyOnceExport --cpus 6`: 2456 runs so far, 0 failures, over 5m0s Epic: CRDB-25287 Release note: None Co-authored-by: Tobias Grieger <[email protected]>
- Loading branch information