Repository navigation
server, agent: concurrent short link updates by several owners - #2005
Draft
spaced4ndy wants to merge 10 commits into
Draft
spaced4ndy wants to merge 10 commits into
spaced4ndy wants to merge 10 commits into
Conversation
…wner # Conflicts: # tests/CoreTests/MsgStoreTests.hs
This branch has not been deployed
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.
The server and client part of channels with several owners: the link server orders owners' changes to a channel's short link, so concurrent changes are neither lost nor overwritten unseen. Design: simplex-chat/simplex-chat#7873
Merging: this stays a draft until the simplex-chat pull request that uses it is ready. Then this one is merged first, and simplex-chat pins the merged commit. The agent part is added to this branch before then.
Protocol (SMP v24)
LSWP: replaces a short link's user data, and optionally the queue's recipient keys, in one step, only when the stored user data has the hash the owner sends. Otherwise it changes nothing and answersLCURwith the stored user data. Recipient command, never forwarded by a proxy.LSETis refused on queues with more than one recipient key, so a single-owner write cannot overwrite data owned by several keys.swapSMPQueueLinksends it only in v24 sessions.Server stores
SELECT … FOR UPDATE).LSETrefusal is checked inside the store, on both stores.LKEYSrecord (data and keys), followed byKEYS; a swap without keys writesLINK. Replay restores both. An older server skipsLKEYSand restores the keys fromKEYS.Transport
Tests and what isn't tested yet
LSETrefusal through a stale queue record, concurrent swaps, restart replay, the size limit, the v24 gate, the proxy refusal.