Skip to content

SQL Server distributed cache backend should perform "slide" UPDATE lazily #55109

Open
@mgravell

Description

@mgravell

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Context: #47596 (comment)

Currently a blanket UPDATE is issued as part of fetch, causing blocking. This could potentially be deferred until we know we actually have sliding expiration (capturing the slide during the SELECT that we need to do anyway). Since sliding expiration is not universal, this may remove many conflicting UPDATE operations

We should also check the indexing on that table

Slight complication: we'd need to think about lock escalation / deadlocks; a read followed by an update risks the situation where two separate SPIDs get competing read locks (possibly row, possibly range page), allowing neither to take their write lock. Locking hints may be appropriate, and we should check the isolation level.

Expected Behavior

Low conflicts accessing the cache table

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

No response

Anything else?

No response

Metadata

Metadata

Assignees

Labels

area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsfeature-cachingIncludes: StackExchangeRedis and SqlServer distributed caches

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions