Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to EventStore.Client >= 20.06 #224

Merged
merged 2 commits into from
Aug 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ The `Unreleased` section name is replaced by the expected version of next releas

### Added

- now targets `Microsoft.Azure.Cosmos` v `3.9.0` (instead of `Microsoft.Azure.DocumentDB`[`.Core`] v 2.x) [#144](https://github.com/jet/equinox/pull/144)
- targets `Microsoft.Azure.Cosmos` v `3.9.0` (instead of `Microsoft.Azure.DocumentDB`[`.Core`] v 2.x) [#144](https://github.com/jet/equinox/pull/144)
- targets `EventStore.Client` v `20.6` (instead of v `5.0.x`) [#224](https://github.com/jet/equinox/pull/224)

### Changed

Expand Down
2 changes: 1 addition & 1 deletion src/Equinox.EventStore/Equinox.EventStore.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<PackageReference Include="FSharp.Core" Version="3.1.2.5" Condition=" '$(TargetFramework)' != 'netstandard2.0' " />
<PackageReference Include="FSharp.Core" Version="4.3.4" Condition=" '$(TargetFramework)' == 'netstandard2.0' " />

<PackageReference Include="EventStore.Client" Version="[5.0.1,6)" />
<PackageReference Include="EventStore.Client" Version="20.6.0" />
<PackageReference Include="FsCodec" Version="2.0.0" />
<PackageReference Include="FSharp.Control.AsyncSeq" Version="2.0.23" />
</ItemGroup>
Expand Down
16 changes: 8 additions & 8 deletions src/Equinox.EventStore/EventStore.fs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ module private Read =
let! slice = readSlice pos batchLog
match slice.Status with
| SliceReadStatus.StreamDeleted -> raise <| EventStore.ClientAPI.Exceptions.StreamDeletedException(slice.Stream)
| SliceReadStatus.StreamNotFound -> yield Some (int64 ExpectedVersion.EmptyStream), Array.empty // EmptyStream must = -1
| SliceReadStatus.StreamNotFound -> yield Some (int64 ExpectedVersion.NoStream), Array.empty // NoStream must = -1
| SliceReadStatus.Success ->
let version = if batchCount = 0 then Some slice.LastEventNumber else None
yield version, slice.Events
Expand Down Expand Up @@ -641,7 +641,7 @@ type Discovery =
// Allow Uri-based connection definition (discovery://, tcp:// or
| Uri of Uri
/// Supply a set of pre-resolved EndPoints instead of letting Gossip resolution derive from the DNS outcome
| GossipSeeded of seedManagerEndpoints : System.Net.IPEndPoint []
| GossipSeeded of seedManagerEndpoints : System.Net.EndPoint []
// Standard Gossip-based discovery based on Dns query and standard manager port
| GossipDns of clusterDns : string
// Standard Gossip-based discovery based on Dns query (with manager port overriding default 30778)
Expand All @@ -650,19 +650,19 @@ type Discovery =
module private Discovery =
let buildDns np (f : DnsClusterSettingsBuilder -> DnsClusterSettingsBuilder) =
ClusterSettings.Create().DiscoverClusterViaDns().KeepDiscovering()
|> fun s -> match np with NodePreference.Random -> s.PreferRandomNode() | NodePreference.PreferSlave -> s.PreferSlaveNode() | _ -> s
|> fun s -> match np with NodePreference.Random -> s.PreferRandomNode() | NodePreference.PreferSlave -> s.PreferFollowerNode() | _ -> s
|> f |> fun s -> s.Build()

let buildSeeded np (f : GossipSeedClusterSettingsBuilder -> GossipSeedClusterSettingsBuilder) =
ClusterSettings.Create().DiscoverClusterViaGossipSeeds().KeepDiscovering()
|> fun s -> match np with NodePreference.Random -> s.PreferRandomNode() | NodePreference.PreferSlave -> s.PreferSlaveNode() | _ -> s
|> fun s -> match np with NodePreference.Random -> s.PreferRandomNode() | NodePreference.PreferSlave -> s.PreferFollowerNode() | _ -> s
|> f |> fun s -> s.Build()

let configureDns clusterDns maybeManagerPort (x : DnsClusterSettingsBuilder) =
x.SetClusterDns(clusterDns)
|> fun s -> match maybeManagerPort with Some port -> s.SetClusterGossipPort(port) | None -> s

let inline configureSeeded (seedEndpoints : System.Net.IPEndPoint []) (x : GossipSeedClusterSettingsBuilder) =
let inline configureSeeded (seedEndpoints : System.Net.EndPoint []) (x : GossipSeedClusterSettingsBuilder) =
x.SetGossipSeedEndPoints(seedEndpoints)

// converts a Discovery mode to a ClusterSettings or a Uri as appropriate
Expand Down Expand Up @@ -697,11 +697,11 @@ type Connector
.LimitRetriesForOperationTo(reqRetries) // ES default: 10
|> fun s ->
match node with
| NodePreference.Master -> s.PerformOnMasterOnly() // explicitly use ES default of requiring master, use default Node preference of Master
| NodePreference.Master -> s.PerformOnLeaderOnly() // explicitly use ES default of requiring master, use default Node preference of Master
| NodePreference.PreferMaster -> s.PerformOnAnyNode() // override default [implied] PerformOnMasterOnly(), use default Node preference of Master
// NB .PreferSlaveNode/.PreferRandomNode setting is ignored if using EventStoreConneciton.Create(ConnectionSettings, ClusterSettings) overload but
// NB .PreferSlaveNode/.PreferRandomNode setting is ignored if using EventStoreConnection.Create(ConnectionSettings, ClusterSettings) overload but
// this code is necessary for cases where people are using the discover :// and related URI schemes
| NodePreference.PreferSlave -> s.PerformOnAnyNode().PreferSlaveNode() // override default PerformOnMasterOnly(), override Master Node preference
| NodePreference.PreferSlave -> s.PerformOnAnyNode().PreferFollowerNode()// override default PerformOnMasterOnly(), override Master Node preference
| NodePreference.Random -> s.PerformOnAnyNode().PreferRandomNode() // override default PerformOnMasterOnly(), override Master Node preference
|> fun s -> match concurrentOperationsLimit with Some col -> s.LimitConcurrentOperationsTo(col) | None -> s // ES default: 5000
|> fun s -> match heartbeatTimeout with Some v -> s.SetHeartbeatTimeout v | None -> s // default: 1500 ms
Expand Down