Skip to content

prevent proxy locking while snapshotting#8131

Merged
timvisee merged 3 commits intodevfrom
prevent-proxy-locking-while-snapshotting
Feb 16, 2026
Merged

prevent proxy locking while snapshotting#8131
timvisee merged 3 commits intodevfrom
prevent-proxy-locking-while-snapshotting

Conversation

@generall
Copy link
Member

@generall generall commented Feb 14, 2026

This PR rolls back changes of #7196

Why it is problematic?

  • Proxy segment was holding a read-lock for the duration of the snapshot, which can be very long.
  • Any update operation had to lock proxy segment for write, was stuck for the duration of the snapshot.
  • with write operations, all other operation were stuck as well

Why it should be ok not to hold the lock?

Proxy segments are design explicitly for this situation - allow read + write operations, while underlying segment is accessed for read for a long time. This is how optimization functions.
Requiring it to be locked for the same duration as wrapped segment essentially kills the idea of proxy segment.


Extra changes of a new updates lock for the duration of proxifying didn't show any improvement, but I think it might be good to have anyway - it prevents update operation from reading/writing directly into wrapped segments after they are already proxified.

☝️ this doesn't work because of deadlock on parallel snapshots

coderabbitai[bot]

This comment was marked as resolved.

Copy link
Member

@timvisee timvisee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a subtle change! Looks good. I see we now only hold a lock on the segment to clone the wrapped segment for a very short period of time.

I did not re-test the deadlock locally, and am assuming you've done that already.

@generall
Copy link
Member Author

I did not re-test the deadlock locally, and am assuming you've done that already.

yes, it is enough to just send update requests to block everything

@timvisee timvisee merged commit e9cd8f6 into dev Feb 16, 2026
15 checks passed
@timvisee timvisee deleted the prevent-proxy-locking-while-snapshotting branch February 16, 2026 09:16
timvisee pushed a commit that referenced this pull request Feb 16, 2026
* [manual] do not lock proxy segmen while accessing wrapped segment

* fmt

* [manual] remove extra update lock
@timvisee timvisee mentioned this pull request Feb 17, 2026
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants