GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Concurrent appends to same stream and ExpectedVersion.Any on Postgres throws WrongExpectedVersion · Issue #478 · SQLStreamStore/SQLStreamStore
This repository was archived by the owner on Aug 15, 2024. It is now read-only.
This repository was archived by the owner on Aug 15, 2024. It is now read-only.
Concurrent appends to same stream and ExpectedVersion.Any on Postgres throws WrongExpectedVersion #478Copy link Copy link Open DescriptionWe tried to concurrently append to the same stream with ExpectedVersion.Any (commutative events), using Postgres as underlying DB, and it fails throwing WrongExpectedVersion. We've tried both using a single connection and with dedicated connections but with the same result. For comparison I tried doing the same with MySQL which deadlocked on a single connection but passed on dedicated connections. I may give SQL Server a whirl tomorrow. The In Memory Store works fine. SSS version: 1.2.0-beta.8 (latest published version of SSS.Postgres on nuget) The example test case below uses dedicated connections (F# with Expecto, if needed I could probably convert it to C# within a few days): ftest "repro concurrency error" { let streamStore () = let settings = SqlStreamStore.PostgresStreamStoreSettings ("Host=localhost;Port=5432;User Id=user;Password=password;Database=db") settings.Schema <- "teststreamstore" new SqlStreamStore.PostgresStreamStore(settings) let appendMsg msg = try (streamStore ()) .AppendToStream(SqlStreamStore.Streams.StreamId ("test"), SqlStreamStore.Streams.ExpectedVersion.Any, [| msg |]) |> Async.AwaitTask with exn -> failtest ("should not fail: " + exn.Message) let message () = SqlStreamStore.Streams.NewStreamMessage (System.Guid.NewGuid (), "some-type", "{}", "{}") List.map (fun _ -> appendMsg (message ())) [ 0 .. 10 ] |> List.map Async.RunSynchronously }; Activity
MetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |