Doc: Clarify that index.routing.allocation.total_shards_per_node means both primary and replica shards
Closes #8002
Clear the GroovyClassLoader cache before compiling

Since we don't use the cache, it's okay to clear it entirely if needed,
Elasticsearch maintains its own cache for compiled scripts.

Adds loader.clearCache() into a listener, the listener is called when a
script is removed from the Guava cache.

This also lowers the amount of cached scripts to 100, since 500 is
around the limit some users have run into before hitting an out of
memory error in permgem.

Fixes #7658
[CORE] Remove leftover unused constants
Tests: Add more logging to ExistsMissingTests.
Docs: Update object-type.asciidoc to make object type more explicit

Closes #7646
Internal: Fix serialization of PendingClusterTask.timeInQueue.

This parameter is serialized as a vLong while it could sometimes be negative.

Close #8077
Docs: Added elasticsearch-dsl-py

Closes #7812
Closes #7813
fix mismatched curly bracket
Docs: Fix (another) Idaho spelling

Closes #7912
Test: make test less evil to not cause OOME
Update completion-suggest.asciidoc

Documented the `size` parameter in the completion suggester query
[CORE] Be more explicit if index.version.created is not set

Today we use the current version which might enable features that are
not supported. We should throw an exception if this setting is not
present for any index.

Closes #8018
Update cjk-bigram-tokenfilter.asciidoc
Core: don't spin 100% CPU when disabling refresh_interval

If refresh was already running when the refresh_interval is
dynamically disabled (set to a non-positive value like 0, -1, etc.),
then it's possible for the refresh thread to go into while (true)
refresh() loop.

Closes #8085

Closes #8087
Tests: check maven central download service is up before running plugin manager test

Though we check that internet connection is fine and that the service is available, it could happen that some services are not available.

```java
assumeTrue(isDownloadServiceWorking("search.maven.org", 80, "/"));
singlePluginInstallAndRemove("org.elasticsearch/elasticsearch-transport-thrift/2.4.0", null);
```

In that case, the first check was successful but downloading thrift plugin from maven central download services was not successful.

This is not an issue with the plugin manager itself but sometimes the test could fail.

Adding a check that actual download service in Maven central works:

```java
assumeTrue(isDownloadServiceWorking("repo1.maven.org", 443, "/maven2/org/elasticsearch/elasticsearch-transport-thrift/2.4.0/elasticsearch-transport-thrift-2.4.0.pom"));
```
[CORE] Add cluster and index state checksums

This commit adds checksumming for cluster and index states. It moves
from a plain XContent based on-disk format to a more structured binary
format including a header and footer as well as a CRC32 checksum for
each of these files. Since previous versions didn't write any format
identifier etc. this commit adds a file extension `.st` for states
that have header/footer and checksum.
This commit also moves over to write temporary files and moves them into
place with an atomic move operation. This commit also serializes and
deserializes the states without materilazing them into opaque memory.

Closes #7586
Log exception thrown in ScriptEngineService.scriptRemoved

Guava would swallow the exception and log it itself if we bubbled it up,
so we catch and log it ourselves to use our logging infrastructure.
Docs: Fix curl statements in query-cache.asciidoc

Closes #7989
Docs: Update highlighting.asciidoc

Added note about how to highlight on the `_all` field

Closes #7991
Internal: dangling indices import ignores aliases

Dangling indices are indexes found on disk which are not part of the cluster state. By default, we don't delete them but rather import them into the cluster state in order to not accidentally delete data and also allow for the ease of copying index data folders from one cluster to another. Currently, the import logic doesn't check for existing aliases of the same name as the imported dangling index, causing both an index and an alias with the same name.

 This commit add a protection against this. Note that the index is still kept as dangling and is only deleted from disk after `gateway.local.dangling_timeout` has passed (2 hours).

 We also change the log message indicating deletion of dangling indices to a `WARN` level.

 Closes #8059