Commit graph

108 commits

Author SHA1 Message Date
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
Johan Andrén
8febed2aed Use dedicated message for PersistentShardCoodinator termination #28093 (#28244)
with a dedicated ShardCoordinator termination message
2019-11-26 11:41:14 +01:00
Helena Edelson
1da15d99b8
Reconsider cluster.role.<role-name>.min-nr-of-members fallback #28177 (#28203) 2019-11-20 08:07:08 -08:00
Patrik Nordwall
a217d5566e
Remove auto-downing, #27788 (#27855)
* moved to cluster tests, in new package akka.cluster.testkit
* changed config in tests
* migration guide
* documentation clarificiations for Downing and Leaving
* update warnings in Singleton and Sharding
2019-10-03 14:08:43 +02:00
Helena Edelson
20238d975f
New base cluster sharding multi-node/jvm test to cleanup and tighten testing (#27740) 2019-09-19 08:14:48 -07:00
Helena Edelson
8a25f186fa Cluster sharding with remember entities (persistence) must setup shared journal (#27692)
* ClusterShardingRememberEntitiesSpec: Cluster sharding with remember entities (persistence) must setup shared journal #27548 - fixed original problem but may have uncovered another in the process.
2019-09-16 14:00:27 +02:00
Christopher Batey
6c13949aec Use protobuf3 for internal serialization (#27366)
* Only load akka protobuf serializer if protobuf on the classpath
2019-08-15 17:43:19 +02:00
Helena Edelson
3534a0b977
Productionize: GetShardRegionStats returns empty shard set on ask timeout (#27395) 2019-07-25 08:00:34 -07:00
Patrik Nordwall
4561994a59 fix serialization failure in ClusterShardingSpec (#27344) 2019-07-12 11:38:03 +02:00
Patrik Nordwall
3efc1c2877
Disable Java serialization by default, #22333 (#27285)
* akka.actor.allow-java-serialization = off
* Moved primitive (Long, Int, String, ByteString) serializers
  from akka-remote to akka-actor since they had no dependency
  and are useful also in local systems, e.g. persistence.
  * e.g. needed for persistence-tck
  * less allow-java-serialization=on in tests
* CborSerializable in Jackson/test module for ease of use
* JavaSerializable for Java serialization in tests, already in akka-testkit,
  but misconfigured
* Made tests pass
  * allow-java-serialization=on in akka-persistence
  * allow-java-serialization=on in classic remoting tests
  * JavaSerializable and CborSerializable in other remoting tests
* Added serialization for
  * Boolean
  * java.util.concurrent.TimeoutException, AskTimeoutException
* support for testing serialization with the inmem journal
* utility to verifySerialization, in SerializationTestKit
* remove AccountExampleWithCommandHandlersInState becuase not possible to serialize State when it's not static
  * Effect() is factory in EventSourcedBehavior  class
* test the account examples
* SharedLeveldbJournal.configToEnableJavaSerializationForTest
* support for exceptions from remote deployed child actors
  * fallback to akka.remote.serialization.ThrowableNotSerializableException
    if exception is not serializable when wrapped in system messages from
    remote deployed child actors and Status.Failure messages
  * it's implemented in `WrappedPayloadSupport.payloadBuilder`
* update reference documentation
* serialize-messages=off in most places, separate ticket for
  improving or removing that feature
* migration guide, including description of rolling update

* fix 2.13 compiler error

* minor review feedback
2019-07-11 14:04:24 +02:00
Patrik Nordwall
1ef65091f6 Deliver buffered messages after passivation, #26957
* This problem was introduced in the optimization in PR #26878,
  and that regression has not been released.
* While waiting for the ddata update response it buffers messages
  for the entity that is stopped/started and in the case of passivation
  those buffered messages were not delivered afterwards. Therefore
  the test failed when waiting for the expected response.
2019-05-20 08:37:58 +02:00
Patrik Nordwall
ce438637bb Improve performance of DDataShard stashing, #26877
* While waiting for update to comple it will now deliver messages to other
  already started entities immediately, instead of stashing
* Unstash one message at a time, instead of unstashAll
* Append messageBuffer for messages to the entity that we are waiting for,
  instead of stashing
* Test to confirm the improvements
* Fixing a few other missing things
  * receiveStartEntity should process the change before starting the entity
  * lastMessageTimestamp should be touched from overridden deliverTo
  * handle StoreFailure
2019-05-16 11:39:28 +02:00
Christopher Batey
e2fafb93d8 Fix config blocks in classic remoting docs (#26851)
* Fix config blocks in classic remoting docs

* Update akka-docs/src/main/paradox/remoting.md

* Update akka-docs/src/main/paradox/remoting.md
2019-05-02 20:20:02 +02:00
Johan Andrén
4bb60bbcc8
akka-cluster-sharding compiler warnings as fatal errors (#26648) 2019-04-05 14:56:33 +02:00
Arnout Engelen
d390fcf183 Introduce warning silencer plugin (#26588)
So now we can compile akka-distributed-data with
-Xfatal-warnings - though I'm not yet sure about
enabling the (other) undisciplineScalacOptions

* Fix multi-node silencing
* Fix scaladoc warnings
* Introduce annotation to declare ccompat use
* Add explicit toString
* Fix deprecation on 2.13
* Move 'immutable' ccompat helpers to shared ccompat package
* Add MiMa for internal scala 2.13 compatibility class
* Internal API markers
* Fix scaladoc generation
Got bitten by https://github.com/scala/bug/issues/11021
2019-03-26 14:41:29 +01:00
Auto Format
75579bed17 format source with scalafmt, #26511 2019-03-15 10:23:46 +01:00
Auto Format
ce404e4f53 format source with scalafmt 2019-03-11 16:58:55 +01:00
Patrik Nordwall
5c96a5f556 replace unicode arrows
* ⇒, →, ←
* because we don't want to show them in documentation snippets and
  then it's complicated to avoid that when snippets are
  located in src/test/scala in individual modules
* dont replace object `→` in FSM.scala and PersistentFSM.scala
2019-03-11 16:58:51 +01:00
Arnout Engelen
d274e039f9
Various scala-2.13.0-M5 fixes
fix akka-actor-tests compile errors

some tests still fail though

Fix test failures in akka-actor-test

Manually work arround missing implicit Factory[Nothing, Seq[Nothing]]

see https://github.com/scala/scala-collection-compat/issues/137

akka-remote scalafix changes

Fix shutdownAll compile error

test:akka-remote scalafix changes

akka-multi-node-testkit scalafix

Fix akka-remote-tests multi-jvm compile errors

akka-stream-tests/test:scalafix

Fix test:akka-stream-tests

Crude implementation of ByteString.map

scalafix akka-actor-typed, akka-actor-typed-tests

akka-actor-typed-tests compile and succeed

scalafix akka-camel

scalafix akka-cluster

akka-cluster compile & test

scalafix akka-cluster-metrics

Fix akka-cluster-metrics

scalafix akka-cluster-tools

akka-cluster-tools compile and test

scalafix akka-distributed-data

akka-distributed-data fixes

scalafix akka-persistence

scalafix akka-cluster-sharding

fix akka-cluster-sharding

scalafix akka-contrib

Fix akka-cluster-sharding-typed test

scalafix akka-docs

Use scala-stm 0.9 (released for M5)

akka-docs

Remove dependency on collections-compat

Cherry-pick the relevant constructs to our own
private utils

Shorten 'scala.collections.immutable' by importing it

Duplicate 'immutable' imports

Use 'foreach' on futures

Replace MapLike with regular Map

Internal API markers

Simplify ccompat by moving PackageShared into object

Since we don't currently need to differentiate between 2.11 and

Avoid relying on 'union' (and ++) being left-biased

Fix akka-actor/doc by removing -Ywarn-unused

Make more things more private

Copyright headers

Use 'unsorted' to go from SortedSet to Set

Duplicate import

Use onComplete rather than failed.foreach

Clarify why we partly duplicate scala-collection-compat
2019-01-11 12:27:18 +01:00
kerr
bdc90052aa Update headers from 2018 to 2019 once for all. (#26165)
* Add CopyrightHeader support for sbt-boilerplate plugin.
* Add CopyrightHeader support for `*.proto` files.
* Add regex match for both `–` and `-` for CopyrightHeader.
* Add CopyrightHeader support for sbt build files.
* Update copyright from 2018 to 2019.
2019-01-02 11:55:26 +01:00
Patrik Nordwall
b48938f4a0
Improve default shard rebalancing algorithm, #26012 (#26101)
* Improve default shard rebalancing algorithm, #26012

* Use rebalance-threshold=1 because it will give the best distribution,
  and previous default could result in too large difference between nodes
* Off by one error, difference > threshold vs >=
* Added more unit tests
* Note that in some cases it may still not be optimal, stopping more
  shards than necessary, but a different strategy that looks at more
  than most and least is out of scope for this issue. In practise
  those cases shouldn't matter much.
* Also note that the rebalance interval is by default 10 seconds,
  so typically shards will start up before next rebalance tick.
  It's intentionally a slow process to not cause instabilities by
  moving too much at the same time.
2018-12-21 13:39:41 +01:00
Helena Edelson
dbfe6f38c7 Rename PersistentBehavior (#25721)
Migrated InternalProtocol with least refactor changes, in the end.
2018-12-05 12:05:59 +01:00
kerr
fafc59b19d update headers to regular comment (#25807) 2018-10-29 05:19:37 -04:00
Saleh Khazaei
176b718b2a Adding maximum restart attempts to BackoffSupervisor #24769 2018-09-14 14:22:52 +02:00
kenji yoshida
5b3b191bac Remove procedure syntax (#25362) 2018-07-25 13:38:27 +02:00
Christopher Batey
28b86379c8 Harden MultiDcClusterShardingSpec (#25201)
- Use global multi node cluster config
- Reduce retry interval for ShardRegion register
- Add clue to unhelpful assert failing
2018-06-15 15:28:04 +02:00
Christopher Batey
01f90ad95d
Add common multi node cluster config to all cluster sharding tests (#25202) 2018-06-05 06:58:17 +01:00
Christopher Batey
5bde26dca6 Fix ClusterShardingIncorrectSetup barrier (#25187)
Barrier needs to be one line down otherwise can fail:
http://jenkins.akka.io:8498/job/akka-artery-cluster-tests/1364/consoleFulllusterShardingIncorrectSetupMultiJvmNode1
2018-06-04 15:04:18 +02:00
Christopher Batey
d03f21a35a
Suggest ClusterSharding hasn't been started in log message (#25177) 2018-05-31 14:43:06 +01:00
Christopher Batey
23373565db
Fix typed cluster singleton cross dc proxies (#24936)
* Fix typed cluster singleton cross dc proxies
* Adds first multi-jvm test for typed cluster
2018-04-27 12:44:44 +01:00
Christopher Batey
a3e52078df Enable header plugin for the MultiJVM configuration (#24974)
Seems when did the changes for 2018 it intro introduced a space in all
after, hence so many changes.
2018-04-25 00:03:55 +09:00
Christopher Batey
4d20b2a660 Reduce size of jenkins logs
Each build is now over 40mb logs.

A lot of DEBUG logging was left on for test failures that have been
fixed. Added an issue # for ones that are still valid or if if it on
as the test verifies debug
2018-04-24 08:49:41 +01:00
Patrik Nordwall
2cd1187e7b entityId => Behavior in ClusterSharding API, #24470
* spawn with String => Behavior since the entityId is often needed
* some type inference is lost, and completely breaks down with overloads
2018-02-02 08:43:11 +01:00
Patrik Nordwall
d30464c452 Reply to GetShardHome requests after rebalance, #24191
* Some GetShardHome requests were ignored (by design) during
  rebalance and they would be retried later.
* This optimization keeps tracks of such requests and reply
  to them immediately after rebalance has been completed and
  thereby the buffered messages in the region don't have to
  wait for next retry tick.
* use regionTerminationInProgress also during the update since
  all GetShardHome requests are not stashed
2018-01-09 20:12:45 +01:00
Patrik Nordwall
0eedd714e8 reply to known shard locations immediately when waitingForUpdate, #24064 2018-01-09 13:51:35 +01:00
Christopher Batey
009214ae07
Update copyright to 2018 (#24241) 2018-01-04 17:26:29 +00:00
Johan Andrén
582f6a4836
Revert source incompatible sharding changes (#24126)
* Revert "fix entityPropsFactory id param, #21809"
This reverts commit cd7eae28f6.
* Revert "Merge pull request #24058 from talpr/talpr-24053-add-entity-id-to-sharding-props"
This reverts commit 8417e70460, reversing
changes made to 22e85f869d.
2017-12-07 17:49:29 +01:00
Patrik Nordwall
cd7eae28f6 fix entityPropsFactory id param, #21809 2017-12-07 13:17:04 +01:00
Patrik Nordwall
8417e70460
Merge pull request #24058 from talpr/talpr-24053-add-entity-id-to-sharding-props
Add entity id to sharding props (#24053)
2017-12-06 07:35:28 +01:00
Tal Pressman
a8e5f48f36 add entity id to sharding props (#24053) 2017-12-05 16:49:05 +02:00
Christopher Batey
76b2cfa676 Add common multi jvm config to cluster tests (#23974) 2017-12-04 15:23:55 +01:00
Christopher Batey
99511a0027 Fix race in ClusterShardingFailureSpec
AFAICT there was nothing ensuring the order of messages when sent to the
shard and the region so first checkthat the passivation has happened
before sending another add in the test

Refs #24013
2017-11-20 16:35:47 +00:00
Christopher Batey
1eb3abb27e
Fix lookup of coordinator for sharding proxies (#23995) 2017-11-15 13:03:48 +00:00
Christopher Batey
83a97256cc Turn on gossip logging for flaky test + improve test error msg (#23868) 2017-10-30 14:52:58 +01:00
Patrik Nordwall
6bfb7c9262 increase timeout in MultiDcSplitBrainSpec
* due to handshake timeout

reduce handshake timeout

fourth might generate UnreachableDataCenter in unsplit

MultiDcClusterSharding
2017-08-31 10:26:23 +02:00
Johan Andrén
9c7e8d027a Renamed/moved the self data center setting #23312 (#23344) 2017-07-12 11:47:32 +01:00
Patrik Nordwall
87d74f1510 Docs for multi-DC features 2017-07-07 16:55:22 +02:00
Patrik Nordwall
bb9549263e Rename team to data center, #23275 2017-07-04 17:11:21 +02:00
Patrik Nordwall
e0fe0bc49e Make cluster sharding DC aware, #23231
* Sharding only within own team (coordinator is singleton)
* the ddata Replicator used by Sharding must also be only within own team
* added support for Set of roles in ddata Replicator so that can be used
  by sharding to specify role + team
* Sharding proxy can route to sharding in another team
2017-07-04 15:04:43 +02:00
Patrik Nordwall
9835c08779 harden ClusterShardingRememberEntitiesSpecNewExtractorSpec 2017-05-23 13:44:24 +02:00