Fix transaction heartbeat watchdog correlation#5573
Closed
mikaelweave wants to merge 1 commit into
Closed
Conversation
Use a non-request cancellation token for SQL transaction heartbeat bookkeeping after merge transaction rows are created. Persist bounded request context on transaction rows for schema V114+ and include it in watchdog cleanup telemetry when available. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ADO 192126.
Why
SQL merge transaction heartbeat bookkeeping was tied to the inbound request cancellation token. If the client canceled after a transaction row was created, heartbeat updates could stop while the server-side row still needed cleanup, leaving watchdog activity harder to correlate back to the originating batch or transaction request.
Approach
dbo.Transactions.Definitionfor schema V114+ and gate the SQL parameter for rolling upgrade compatibility.114.diff.sql, update base sprocs, and bump SQL latest schema version to 114.Notes
The stored context is intentionally bounded to the existing
varchar(2000)column and excludes the full URI and query string. Older schemas do not receive@Definition, and the timeout read path tolerates missing definition columns.Validation
dotnet test src\Microsoft.Health.Fhir.SqlServer.UnitTests\Microsoft.Health.Fhir.SqlServer.UnitTests.csproj --no-restore --filter "FullyQualifiedName~SqlServerFhirDataStoreUnitTests|FullyQualifiedName~SqlStoreClientTests|FullyQualifiedName~TransactionWatchdogTests" --logger "console;verbosity=minimal"git diff --check