Skip to content

Commit aedb9c6

Browse files
Merge pull request #4479 from akkadotnet/dev
v1.4.8 Release
2 parents 4fa4a39 + f43f370 commit aedb9c6

File tree

38 files changed

+1033
-60
lines changed

38 files changed

+1033
-60
lines changed

RELEASE_NOTES.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
#### 1.4.8 June 17 2020 ####
2+
**Maintenance Release for Akka.NET 1.4**
3+
4+
Akka.NET v1.4.8 features some important bug fixes for Akka.NET v1.4:
5+
6+
* [Akka: fix issue with setting IActorRefProvider via BootstrapSetup](https://github.com/akkadotnet/akka.net/pull/4473)
7+
* [Akka.Cluster: Akka v1.4 Idle CPU usage increased comparing v1.3](https://github.com/akkadotnet/akka.net/issues/4434)
8+
* [Akka.Cluster.Sharding: Backport of the feature called ClusterDistribution in Lagom](https://github.com/akkadotnet/akka.net/pull/4455)
9+
* [Akka.TestKit: added ActorSystemSetup overload for TestKits](https://github.com/akkadotnet/akka.net/pull/4464)
10+
11+
To see the [full set of fixes in Akka.NET v1.4.8, please see the milestone on Github](https://github.com/akkadotnet/akka.net/milestone/39).
12+
13+
| COMMITS | LOC+ | LOC- | AUTHOR |
14+
| --- | --- | --- | --- |
15+
| 7 | 310 | 24 | Aaron Stannard |
16+
| 6 | 8 | 8 | dependabot-preview[bot] |
17+
| 2 | 669 | 10 | Ismael Hamed |
18+
| 2 | 38 | 27 | Gregorius Soedharmo |
19+
| 1 | 1 | 1 | Bartosz Sypytkowski |
20+
121
#### 1.4.7 May 26 2020 ####
222
**Maintenance Release for Akka.NET 1.4**
323

build-system/azure-pipeline.mntr-template.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ jobs:
1616
pool:
1717
vmImage: ${{ parameters.vmImage }}
1818
steps:
19+
- task: UseDotNet@2
20+
displayName: 'Use .NET Core SDK 3.1.105'
21+
inputs:
22+
packageType: sdk
23+
version: 3.1.105
1924
- task: Bash@3
2025
displayName: Linux / OSX Build
2126
inputs:

build-system/azure-pipeline.template.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ jobs:
1616
pool:
1717
vmImage: ${{ parameters.vmImage }}
1818
steps:
19+
- task: UseDotNet@2
20+
displayName: 'Use .NET Core SDK 3.1.105'
21+
inputs:
22+
packageType: sdk
23+
version: 3.1.105
1924
- task: Bash@3
2025
displayName: Linux / OSX Build
2126
inputs:

build-system/nightly-builds.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ variables:
1919
- group: nugetKeys #create this group with SECRET variables `nugetKey`
2020

2121
steps:
22+
- task: UseDotNet@2
23+
displayName: 'Use .NET Core SDK 3.1.105'
24+
inputs:
25+
packageType: sdk
26+
version: 3.1.105
2227
- task: BatchScript@1
2328
displayName: 'FAKE Build'
2429
inputs:

build-system/pr-validation.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ trigger:
66
- dev
77
- v1.*
88
- master
9+
- feature/*
910

1011
pr:
1112
autoCancel: true # indicates whether additional pushes to a PR should cancel in-progress runs for the same PR. Defaults to true
1213
branches:
13-
include: [ dev, v1.*, master ] # branch names which will trigger a build
14+
include: [ dev, v1.*, master, feature/* ] # branch names which will trigger a build
1415

1516
name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)
1617

@@ -25,6 +26,11 @@ jobs:
2526
clean: false # whether to fetch clean each time
2627
submodules: recursive # set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules
2728
persistCredentials: true
29+
- task: UseDotNet@2
30+
displayName: 'Use .NET Core SDK 3.1.105'
31+
inputs:
32+
packageType: sdk
33+
version: 3.1.105
2834
- task: BatchScript@1
2935
displayName: Windows Build
3036
inputs:

build-system/windows-release.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ variables:
2222
- name: githubRepositoryName
2323
value: akkadotnet/akka.net
2424
steps:
25+
- task: UseDotNet@2
26+
displayName: 'Use .NET Core SDK 3.1.105'
27+
inputs:
28+
packageType: sdk
29+
version: 3.1.105
2530
- task: BatchScript@1
2631
displayName: 'FAKE Build'
2732
inputs:

build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Param(
3131

3232
$FakeVersion = "4.63.0"
3333
$DotNetChannel = "LTS";
34-
$DotNetVersion = "3.1.100";
34+
$DotNetVersion = "3.1.105";
3535
$DotNetInstallerUri = "https://dot.net/v1/dotnet-install.ps1";
3636
$NugetVersion = "4.3.0";
3737
$NugetUrl = "https://dist.nuget.org/win-x86-commandline/v$NugetVersion/nuget.exe"
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Sharded Daemon Process
2+
3+
> [!WARNING]
4+
>This module is currently marked as [may change](../utilities/may-change.md) because it is a new feature that
5+
>needs feedback from real usage before finalizing the API. This means that API or semantics can change without
6+
>warning or deprecation period. It is also not recommended to use this module in production just yet.
7+
8+
## Introduction
9+
10+
Sharded Daemon Process provides a way to run `N` actors, each given a numeric id starting from `0` that are then kept alive
11+
and balanced across the cluster. When a rebalance is needed the actor is stopped and, triggered by a keep alive running on
12+
all nodes, started on a new node (the keep alive should be seen as an implementation detail and may change in future versions).
13+
14+
The intended use case is for splitting data processing workloads across a set number of workers that each get to work on a subset
15+
of the data that needs to be processed. This is commonly needed to create projections based on the event streams available
16+
from all the [Persistent Actors](../persistence/event-sourcing.md) in a CQRS application. Events are tagged with one out of `N` tags
17+
used to split the workload of consuming and updating a projection between `N` workers.
18+
19+
For cases where a single actor needs to be kept alive see [Cluster Singleton](cluster-singleton.md)
20+
21+
## Basic example
22+
23+
To set up a set of actors running with Sharded Daemon process each node in the cluster needs to run the same initialization
24+
when starting up:
25+
26+
[!code-csharp[ShardedDaemonProcessSpec.cs](../../../src/contrib/cluster/Akka.Cluster.Sharding.Tests/ShardedDaemonProcessSpec.cs?name=tag-processing)]
27+
28+
## Scalability
29+
30+
This cluster tool is intended for small numbers of consumers and will not scale well to a large set. In large clusters
31+
it is recommended to limit the nodes the sharded daemon process will run on using a role.

docs/articles/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,8 @@
172172
href: clustering/cluster-client.md
173173
- name: Cluster Sharding
174174
href: clustering/cluster-sharding.md
175+
- name: Sharded Daemon Process
176+
href: clustering/cluster-sharded-daemon-process.md
175177
- name: Cluster Metrics
176178
href: clustering/cluster-metrics.md
177179
- name: Distributed Data

src/common.props

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<PropertyGroup>
33
<Copyright>Copyright © 2013-2020 Akka.NET Team</Copyright>
44
<Authors>Akka.NET Team</Authors>
5-
<VersionPrefix>1.4.4</VersionPrefix>
5+
<VersionPrefix>1.4.8</VersionPrefix>
66
<PackageIconUrl>http://getakka.net/images/akkalogo.png</PackageIconUrl>
77
<PackageProjectUrl>https://github.com/akkadotnet/akka.net</PackageProjectUrl>
88
<PackageLicenseUrl>https://github.com/akkadotnet/akka.net/blob/master/LICENSE</PackageLicenseUrl>
@@ -11,16 +11,16 @@
1111
<PropertyGroup>
1212
<XunitVersion>2.4.1</XunitVersion>
1313
<TestSdkVersion>16.6.1</TestSdkVersion>
14-
<HyperionVersion>0.9.15</HyperionVersion>
14+
<HyperionVersion>0.9.16</HyperionVersion>
1515
<NewtonsoftJsonVersion>12.0.3</NewtonsoftJsonVersion>
1616
<NBenchVersion>2.0.1</NBenchVersion>
17-
<ProtobufVersion>3.12.1</ProtobufVersion>
17+
<ProtobufVersion>3.12.3</ProtobufVersion>
1818
<NetCoreTestVersion>netcoreapp3.1</NetCoreTestVersion>
1919
<NetFrameworkTestVersion>net461</NetFrameworkTestVersion>
2020
<NetStandardLibVersion>netstandard2.0</NetStandardLibVersion>
2121
<NetFrameworkLibVersion>net452</NetFrameworkLibVersion>
2222
<FluentAssertionsVersion>4.14.0</FluentAssertionsVersion>
23-
<FsCheckVersion>2.14.2</FsCheckVersion>
23+
<FsCheckVersion>2.14.3</FsCheckVersion>
2424
<HoconVersion>2.0.3</HoconVersion>
2525
<ConfigurationManagerVersion>4.7.0</ConfigurationManagerVersion>
2626
<AkkaPackageTags>akka;actors;actor model;Akka;concurrency</AkkaPackageTags>
@@ -29,21 +29,7 @@
2929
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
3030
</PropertyGroup>
3131
<PropertyGroup>
32-
<PackageReleaseNotes>Maintenance Release for Akka.NET 1.4**
33-
Akka.NET v1.4.4 includes one major fix for HOCON fallback configurations, a new module (Akka.Coordination), and some major improvements to Akka.Cluster.Tools / Akka.Cluster.Sharding:
34-
[Akka.Coordination: Lease API &amp; integration](https://github.com/akkadotnet/akka.net/pull/4344)
35-
[Akka: Timers for self scheduled messages added, FSM timers fixes](https://github.com/akkadotnet/akka.net/pull/3778)
36-
[Akka **Important** Bugfix: Config.WithFallback is acting inconsistently](https://github.com/akkadotnet/akka.net/pull/4358)
37-
[Akka.Cluster.Sharding: Updates](https://github.com/akkadotnet/akka.net/pull/4354)
38-
To see the full set of changes for Akka.NET 1.4.4, please [see the 1.4.4 milestone](https://github.com/akkadotnet/akka.net/milestone/35).
39-
| COMMITS | LOC+ | LOC- | AUTHOR |
40-
| --- | --- | --- | --- |
41-
| 3 | 4845 | 225 | zbynek001 |
42-
| 2 | 3 | 3 | dependabot-preview[bot] |
43-
| 2 | 159 | 0 | Aaron Stannard |
44-
| 2 | 1099 | 23 | Gregorius Soedharmo |
45-
| 1 | 34 | 5 | Petri Kero |
46-
| 1 | 1 | 1 | Felix Reisinger |</PackageReleaseNotes>
32+
<PackageReleaseNotes>Placeholder for nightlies**</PackageReleaseNotes>
4733
</PropertyGroup>
4834
<!-- SourceLink support for all Akka.NET projects -->
4935
<ItemGroup>
Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
//-----------------------------------------------------------------------
2+
// <copyright file="ClusterShardingSpec.cs" company="Akka.NET Project">
3+
// Copyright (C) 2009-2020 Lightbend Inc. <http://www.lightbend.com>
4+
// Copyright (C) 2013-2020 .NET Foundation <https://github.com/akkadotnet/akka.net>
5+
// </copyright>
6+
//-----------------------------------------------------------------------
7+
8+
using System;
9+
using System.Linq;
10+
using Akka.Actor;
11+
using Akka.Cluster.TestKit;
12+
using Akka.Cluster.Tools.Singleton;
13+
using Akka.Configuration;
14+
using Akka.Remote.TestKit;
15+
using FluentAssertions;
16+
17+
namespace Akka.Cluster.Sharding.Tests.MultiNode
18+
{
19+
public class ShardedDaemonProcessSpecConfig : MultiNodeConfig
20+
{
21+
public RoleName First { get; }
22+
public RoleName Second { get; }
23+
public RoleName Third { get; }
24+
25+
public ShardedDaemonProcessSpecConfig()
26+
{
27+
First = Role("first");
28+
Second = Role("second");
29+
Third = Role("third");
30+
31+
CommonConfig = DebugConfig(false)
32+
.WithFallback(ConfigurationFactory.ParseString(@"
33+
akka.loglevel = INFO
34+
akka.cluster.sharded-daemon-process {{
35+
sharding {{
36+
# First is likely to be ignored as shard coordinator not ready
37+
retry-interval = 0.2s
38+
}}
39+
# quick ping to make test swift
40+
keep-alive-interval = 1s
41+
}}
42+
"))
43+
.WithFallback(ClusterSharding.DefaultConfig())
44+
.WithFallback(ClusterSingletonManager.DefaultConfig())
45+
.WithFallback(MultiNodeClusterSpec.ClusterConfig());
46+
}
47+
}
48+
49+
public class ShardedDaemonProcessMultiNode : ShardedDaemonProcessSpec
50+
{
51+
public ShardedDaemonProcessMultiNode() : this(new ShardedDaemonProcessSpecConfig()) { }
52+
protected ShardedDaemonProcessMultiNode(ShardedDaemonProcessSpecConfig config) : base(config, typeof(ShardedDaemonProcessMultiNode)) { }
53+
}
54+
55+
public abstract class ShardedDaemonProcessSpec : MultiNodeClusterSpec
56+
{
57+
private readonly ShardedDaemonProcessSpecConfig _config;
58+
59+
protected ShardedDaemonProcessSpec(ShardedDaemonProcessSpecConfig config, Type type)
60+
: base(config, type)
61+
{
62+
_config = config;
63+
}
64+
65+
[MultiNodeFact]
66+
public void ShardedDaemonProcess_Specs()
67+
{
68+
ShardedDaemonProcess_Should_Init_Actor_Set();
69+
}
70+
71+
public void ShardedDaemonProcess_Should_Init_Actor_Set()
72+
{
73+
// HACK
74+
RunOn(() => FormCluster(_config.First, _config.Second, _config.Third), _config.First);
75+
76+
var probe = CreateTestProbe();
77+
ShardedDaemonProcess.Get(Sys).Init("the-fearless", 4, id => ProcessActor.Props(id, probe.Ref));
78+
EnterBarrier("actor-set-initialized");
79+
80+
RunOn(() =>
81+
{
82+
var startedIds = Enumerable.Range(0, 4).Select(_ =>
83+
{
84+
var evt = probe.ExpectMsg<ProcessActorEvent>(TimeSpan.FromSeconds(5));
85+
evt.Event.Should().Be("Started");
86+
return evt.Id;
87+
}).ToList();
88+
startedIds.Count.Should().Be(4);
89+
}, _config.First);
90+
EnterBarrier("actor-set-started");
91+
}
92+
93+
private void FormCluster(RoleName first, params RoleName[] rest)
94+
{
95+
RunOn(() =>
96+
{
97+
Cluster.Join(GetAddress(first));
98+
AwaitAssert(() =>
99+
{
100+
Cluster.State.Members.Select(i => i.UniqueAddress).Should().Contain(Cluster.SelfUniqueAddress);
101+
Cluster.State.Members.Select(i => i.Status).Should().OnlyContain(i => i == MemberStatus.Up);
102+
});
103+
}, first);
104+
EnterBarrier(first.Name + "-joined");
105+
106+
foreach (var node in rest)
107+
{
108+
RunOn(() =>
109+
{
110+
Cluster.Join(GetAddress(first));
111+
AwaitAssert(() =>
112+
{
113+
Cluster.State.Members.Select(i => i.UniqueAddress).Should().Contain(Cluster.SelfUniqueAddress);
114+
Cluster.State.Members.Select(i => i.Status).Should().OnlyContain(i => i == MemberStatus.Up);
115+
});
116+
}, node);
117+
}
118+
EnterBarrier("all-joined");
119+
}
120+
}
121+
122+
internal class ProcessActor : UntypedActor
123+
{
124+
#region Protocol
125+
126+
[Serializable]
127+
public sealed class Stop
128+
{
129+
public static readonly Stop Instance = new Stop();
130+
private Stop() { }
131+
}
132+
133+
#endregion
134+
135+
public static Props Props(int id, IActorRef probe) =>
136+
Actor.Props.Create(() => new ProcessActor(id, probe));
137+
138+
public ProcessActor(int id, IActorRef probe)
139+
{
140+
Probe = probe;
141+
Id = id;
142+
}
143+
144+
public IActorRef Probe { get; }
145+
public int Id { get; }
146+
147+
protected override void PreStart()
148+
{
149+
base.PreStart();
150+
Probe.Tell(new ProcessActorEvent(Id, "Started"));
151+
}
152+
153+
protected override void OnReceive(object message)
154+
{
155+
if (message is Stop)
156+
{
157+
Probe.Tell(new ProcessActorEvent(Id, "Stopped"));
158+
Context.Stop(Self);
159+
}
160+
}
161+
}
162+
163+
internal sealed class ProcessActorEvent
164+
{
165+
public ProcessActorEvent(int id, object @event)
166+
{
167+
Id = id;
168+
Event = @event;
169+
}
170+
171+
public int Id { get; }
172+
public object Event { get; }
173+
}
174+
}

0 commit comments

Comments
 (0)