Commit graph

157 commits

Author SHA1 Message Date
Johan Andrén
c5655a9ce6
Upgrade to Scala 2.13.5 (#30072) 2021-03-30 20:57:23 +02:00
Patrik Nordwall
d19855542b
configuration for SBR lease release #30090 (#30092) 2021-03-11 13:29:20 +01:00
Nicolas Vollmar
278a36d036
Adds explicit ! method (#30004)
Needed for Scala 3
2021-02-10 13:20:29 +01:00
Arnout Engelen
31f654768f
Update copyright to 2021 2021-01-08 17:55:38 +01:00
ohze.net
9416dedad7
Use scalafix to update scala 2.13.3, silencer 1.7.0 (#29367) 2020-12-09 09:20:13 +01:00
Renato Cavalcanti
028ad29164
Fix cluster sharding with remember entities test (#29773)
* fix cluster sharding with remember entities test

* send BeginHandOff to all regions
2020-11-02 17:09:56 +01:00
Renato Cavalcanti
289f665445
Make a distinction between hand-offs for rebalance and region shutdown (#29579) 2020-09-29 12:54:54 +02:00
Johan Andrén
cadab9388f
Cluster aware shard allocation and rolling updates (#29548)
Adds some level of cluster awareness to both the LeastShardAllocationStrategy implementations:

* #27368 prefer shard allocations on new nodes during rolling updates
* #27367 don't rebalance during rolling update
* #29554 don't rebalance when there are joining nodes
* #29553 don't allocate to leaving, downed, exiting and unreachable nodes
* When allocating when there are joining, unreachable, are leaving are de-prioritized to decrease the risk that a shard is allocated just to directly need to be re-allocated on a different node.
2020-09-21 14:13:32 +02:00
Patrik Nordwall
f0b3c9089b
Holistic shard allocation strategy, #29543 (#29555)
* The rebalance in the LeastShardAllocationStrategy is only comparing the region
  with most shards with the one with least shards. Makes the rebalance rather
  slow. By default it's only rebalancing 1 shard at a time.
* This new strategy looks at all current allocations to find the optimal
  number of shards per region and tries to adjust towards that value.
  Picking from all regions with more shards than the optimal.
* Absolute and relative limit on how many shards that can be rebalanced
  in one round.
* It's also not starting a new rebalance round until the previous has
  completed.
* unit tests
* second phase for fine grained rebalance, due to rounding it will not be perfect in the first phase
* randomized unit test
* configuration settings
* docs
2020-09-11 08:49:45 +02:00
Patrik Nordwall
ae83968286
Merge pull request #29474 from akka/wip-29423-ClusterSingletonManagerLeaseSpec-patriknw
harden ClusterSingletonManagerLeaseSpec, #29423
2020-08-18 12:23:07 +02:00
Patrik Nordwall
34dfca53c8
Merge pull request #29496 from akka/wip-29185-RandomizedSplitBrainResolverIntegrationSpec-patriknw
reduce combinations in RandomizedBrainResolverIntegrationSpec, #29185
2020-08-18 12:20:01 +02:00
Christopher Batey
c934511c42
Forward terminated from ShardCoordinator to RebalanceWorker (#29463)
* Forward terminated from ShardCoordinator to RebalanceWorker

Avoiding the need for rebalance workers to watch shard regions which is
expensive as there is one rebalance worker per shard

* Review feedback
2020-08-18 11:25:01 +02:00
Patrik Nordwall
4be0b3c776 reduce combinations in RandomizedBrainResolverIntegrationSpec, #29185
* when the test generated scenarios that continued "instability" it
  could result in that node wasn't removed before new became active
2020-08-17 11:25:20 +02:00
Patrik Nordwall
fc44a02ae2 harden ClusterSingletonManagerLeaseSpec, #29423
* default test timeout too short for the join
2020-08-10 14:58:29 +02:00
Johan Andrén
01edcab657
Allow entities to stop by terminating without remember entities (#29384)
* Allow entities to stop by terminating in sharding without remember entities #29383
  We missed an allowed transition from running/active to stopped/NoState in shard. 
  when the logic was rewritten.
* Add a toggle to opt-in crash shard on illegal state transitions
  Default is logging an error and not crashing shard and all other entities, our tests have the toggle enabled.
* A fix for passivation when not using remember entities fixing #29359 and possibly #27549
2020-07-15 08:38:23 +02:00
Christopher Batey
edd246de4c ClusterShardingSpec: Enable log capturing 2020-06-29 12:21:59 +01:00
Christopher Batey
c8f60af709
DEBUG logging for cluster sahrding leaving spec (#29180) 2020-06-04 15:07:27 +02:00
Johan Andrén
5643f7e194
Problems with StartEntityAck, StartEntity and the persistent test running with ddata remember entities (#29161) 2020-06-02 14:59:38 +02:00
Johan Andrén
5d42c929ef I gotta remove these empty files 2020-06-01 17:36:49 +02:00
Johan Andrén
e89b108765 Scalafmt wants an empty line after header 2020-06-01 15:51:32 +02:00
Johan Andrén
012140e814 Missing headers 2020-06-01 15:06:19 +02:00
Johan Andrén
5b5e3577e2 Some changes on top of changes from master 2020-06-01 14:30:28 +02:00
Johan Andrén
5bbf5a5a21 Merge branch 'master' again to get the latest sharding fixes 2020-06-01 12:57:51 +02:00
Johan Andrén
b9667fb6b3
Batch remember entity stops (#29149) 2020-06-01 11:03:03 +02:00
Christopher Batey
0d1237fd44
Latency benchmarks for rememered entities + JFR events (#29103) 2020-05-28 09:35:27 +02:00
Christopher Batey
b463a1adbd
Merge master into re feature branch (#29135)
* Merge master into feature branch

* Formatting

* Remove redundant fixme

* Remove files that snuck in

* Fix backoff supervisor test
2020-05-27 12:50:53 +01:00
Patrik Nordwall
95111955c4 Don't allocate to terminated regions, #29131
* when using down-removal-margin it could allocate to an
  already terminated region
* the watch fix in PR #29092 solves this
* this is an "optimization" to avoid the regions that
  have been terminated
2020-05-27 11:09:59 +02:00
Patrik Nordwall
7c77617d18
Merge pull request #29092 from akka/wip-29034-sharding-watch-patriknw
Allow ShardCoordinator to watch old region ActorRef that is not in cluster, #29034
2020-05-27 10:06:38 +02:00
Patrik Nordwall
c45e6ef39b
Add Lightbend's SBR to Akka Cluster, #29085 (#29099)
* change package name to akka.cluster.sbr
* reference.conf has same config paths
* akka.cluster.sbr.SplitBrainResolverProvider instead of com.lightbend.akka.sbr.SplitBrainResolverProvider
* dependency from akka-cluster to akka-coordination, for lease strategy
* move TestLease to akka-coordination and use that in SBR tests
* remove keep-referee strategy
* use keep-majority by default
* review and adjust reference documentation

Co-authored-by: Johan Andrén <johan@markatta.com>
Co-authored-by: Johannes Rudolph <johannes.rudolph@gmail.com>
Co-authored-by: Christopher Batey <christopher.batey@gmail.com>
Co-authored-by: Arnout Engelen <github@bzzt.net>
2020-05-25 12:21:13 +02:00
Patrik Nordwall
3deffc8de2
Harden ShardCoordinator state replication, #28856 (#28895) (#29094)
* Possibility to prefer oldest in ddata writes and reads
  * enabled for Cluster Sharding
* New ReadMajorityPlus and WriteMajorityPlus
  * used by Cluster Sharding, with configuration
  * also possible to define ReadAll in config

(cherry picked from commit 4ba835d328)
2020-05-20 07:34:22 +01:00
Patrik Nordwall
228c19e688 Allow ShardCoordinator to watch old region ActorRef that is not in cluster, #29034
* Otherwise the remote watch is disabled and the old region ActorRef remains
  in the coordinator's state
2020-05-19 13:53:42 +02:00
Christopher Batey
33226dbffc
Batch entitiy start updates for remembered entities (#29064)
* Initial prototype for batching entity creates
2020-05-14 11:38:09 +01:00
Johan Andrén
6f8f44b3df
Coordinator ddata state store with persistent remember entities (#29043)
* WIP

* Test and config update

* Multi-jvm tests updated to cover ddata state + persistent remember entities
2020-05-11 11:17:29 +01:00
Christopher Batey
b2509efdb0
Bulk update of external shard allocation (#28699)
* Apply suggestions from code review
Co-authored-by: Sean Glover <sean@seanglover.com>
2020-05-05 17:18:44 +02:00
Johan Andrén
bc2671757f
A stash that should have been buffer #28957 (#28987) 2020-05-05 10:45:49 +02:00
Patrik Nordwall
e01396843e Complete GetClusterShardingStats query, #24466 2020-04-30 11:27:25 +02:00
Johan Andrén
29d288a4ba
Shard coordinator remember entities refactor (#28909)
* Simplified coordinator ddata store
2020-04-28 08:58:14 +02:00
kerr
0e4d41ad33
+build Add sort imports support. (#28780)
* Add scalafix plugin for jdk 9.
* Add command alias sortImports.
* Excludes some sources from SortImports.
* Update SortImports to 0.4.0
* Sort imports with `sortImports` command.
2020-04-27 14:32:18 +02:00
ohze.net
ea7205eaf7
dotty phase 2: scalafix ExplicitNonNullaryApply (#28949)
* scalafix ExplicitNonNullaryApply prepare

+ Temporarily use com.sandinh:sbt-scalafix because scalacenter/scalafix#1098
+ Add ExplicitNonNullaryApply rule to .scalafix.conf
+ Manually fix a NonNullaryApply case in DeathWatchSpec that cause
  `fixall` fail because ExplicitNonNullaryApply rule incorrectly rewrite
  `context unbecome` to `context unbecome()` instead of `context.unbecome()`

* scalafix ExplicitNonNullaryApply

fix by enabling only ExplicitNonNullaryApply rule in .scalafix.conf then:
```
% sbt -Dakka.build.scalaVersion=2.13.1
> fixall
```

* scalafmtAll

* Revert to ch.epfl.scala:sbt-scalafix

Co-authored-by: Bùi Việt Thành <thanhbv@sandinh.net>
2020-04-27 12:31:16 +02:00
Patrik Nordwall
4ba835d328
Harden ShardCoordinator state replication, #28856 (#28895)
* Possibility to prefer oldest in ddata writes and reads
  * enabled for Cluster Sharding
* New ReadMajorityPlus and WriteMajorityPlus
  * used by Cluster Sharding, with configuration
  * also possible to define ReadAll in config
2020-04-24 14:19:53 +02:00
Bùi Việt Thành
02b9b30354 scalafix ExplicitResultTypes - for implicit members 2020-04-20 17:59:50 +07:00
Johan Andrén
722b68e7cc
Refactor remember entitites in shards (#28776)
* DData and Persistence based remember entitites refactored
* Order methods in the order of init in the shard.
* Some bad isolation between test cases causing problems
* Test coverage for remember entities store failures
* WithLogCapturing where applicable
* MiMa filters
* Timeouts from config for persistent remember entities
* Single method for deliver, less utf-8 encoding
* Include detail on write failure
* Don't send message to dead letter if it is actually handled in BackOffSupervisor
* Back off supervisor log format plus use warning for hitting max restarts
* actor/message based spi
* Missing assert that node had joined cluster
2020-04-03 14:57:49 +02:00
Johan Andrén
fa5e8324b0
A missing rememberEntities in one test re-added (#28671) 2020-03-02 18:21:01 +01:00
Helena Edelson
6fe2f66adc
Multi node test hardening for Sharding #27749 (#28631) 2020-02-27 12:05:55 -08:00
Helena Edelson
26c333b52c
Productionize CurrentShardRegionState #27406 (#28645) 2020-02-26 10:32:28 -08:00
Patrik Nordwall
b30f8746d3
Merge pull request #28470 from akka/wip-28416-region-reg-patriknw
Shard region registration to more potential oldest, #28416
2020-01-22 08:40:01 +01:00
Christopher Batey
cbf9f71c32
External shard allocation strategy (#28211) 2020-01-21 16:08:51 +00:00
Patrik Nordwall
1c9fd61d57 Shard region registration to more potential oldest, #28416
* Keep track of Leaving and Exiting members in ShardRegion and
  attempt to register to coordinator at several of the oldest if
  they have status Leaving and Exiting. Include all up to and
  including the first member with status Up.
* Sending to wrong node doesn't matter, will be suppressed deadLetter.
* Same for the GracefulShutdownReq which already had that intention by
  sending to 2 oldest.
2020-01-10 15:09:50 +01:00
Helena Edelson
6bf20f4117 Update all copyright headers to 2020 after new year's #27881 (#28434) 2020-01-02 13:24:59 +01:00
Arnout Engelen
c337bf5287 Remove use of getClass in secondary constructors (#28355)
* Remove use of getClass in secondary constructors

As this is not allowed anymore on newer versions of scala, and likely
didn't work correctly in the past either

This might make selecting unique actor system names for test
actor systems a bit less reliable, but that didn't seem to be
critical anyway.

Thanks to @som-snytt for the heads-up and initial implementation
in #28353

* Avoid AkkaSpec.getCallerName in MultiNodeClusterShardingConfig

* StreamSpec can be abstract

* Use more sophisticated test class name logic

* scalafmt
2019-12-16 13:04:09 +01:00