Skip to content

Commit

Permalink
allow partitions to lock when joining to delete instance (#2863)
Browse files Browse the repository at this point in the history
## Description
allow partitions to lock when joining to delete instance so we get
latest data

## Related issues
Addresses
[[AB#105059](https://microsofthealth.visualstudio.com/f8da5110-49b1-4e9f-9022-2f58b6124ff9/_workitems/edit/105059)].

## Testing
n/a
  • Loading branch information
esmadau authored Jul 6, 2023
1 parent 5ce243e commit 3337608
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ BEGIN
d.OriginalWatermark
FROM dbo.DeletedInstance AS d WITH (UPDLOCK, READPAST)
INNER JOIN
dbo.Partition AS p WITH (NOLOCK)
dbo.Partition AS p
ON p.PartitionKey = d.PartitionKey
WHERE RetryCount <= @maxRetries
AND CleanupAfter < SYSUTCDATETIME();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2630,7 +2630,7 @@ BEGIN
d.OriginalWatermark
FROM dbo.DeletedInstance AS d WITH (UPDLOCK, READPAST)
INNER JOIN
dbo.Partition AS p WITH (NOLOCK)
dbo.Partition AS p
ON p.PartitionKey = d.PartitionKey
WHERE RetryCount <= @maxRetries
AND CleanupAfter < SYSUTCDATETIME();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ BEGIN

SELECT TOP (@count) p.PartitionName, d.PartitionKey, d.StudyInstanceUid, d.SeriesInstanceUid, d.SopInstanceUid, d.Watermark, d.OriginalWatermark
FROM dbo.DeletedInstance as d WITH (UPDLOCK, READPAST)
INNER JOIN dbo.Partition as p WITH (NOLOCK)
INNER JOIN dbo.Partition as p
ON p.PartitionKey = d.PartitionKey
WHERE RetryCount <= @maxRetries
AND CleanupAfter < SYSUTCDATETIME()
Expand Down

0 comments on commit 3337608

Please sign in to comment.