Bulk operation can create duplicates on primary relocation
When executing a bulk request, with create index operation and auto generate id, if while the primary is relocating the bulk is executed, and the relocation is done while N items from the bulk have executed, the full shard bulk request will be retried on the new primary. This can create duplicates because the request is not makred as potentially holding conflicts.

This change carries over the response for each item on the request level, and if a conflict is detected on the primary shard, and the response is there (indicating that the request was executed once already), use the mentioned response as the actual response for that bulk shard item.

On top of that, when a primary fails and is retried, the change now marks the request as potentially causing duplicates, so the actual impl will do the extra lookup needed.

This change also fixes a bug in our exception handling on the replica, where if a specific item failed, and its not an exception we can ignore, we should actually cause the shard to fail.

closes #7729
[TEST] Disable truncate in network corruption tests

This test sometimes corrupts a file by truncating a chunk on the
network layer. Yet this was not detected and required changes in the
wire protocol. It's fixed in 1.4 see #7830 for details

Relates to #7830
Chunk direct buffer usage by networking layer
Today, due to how netty works (both on http layer and transport layer), and even though the buffers sent over to netty are paged (CompositeChannelBuffer), it ends up re-copying the whole buffer into another heap buffer (bad), and then send it over directly to sun.nio which allocates a full thread local direct buffer to send it (which can be repeated if not all message is sent).
  This is problematic for very large messages, aside from the extra heap temporal usage, the large direct buffers will stay around and not released by the JVM.
  This change forces the use of gathering when building a CompositeChannelBuffer, which results in netty using the sun.nio write method that accepts an array of ByteBuffer (so no extra heap copying), and also reduces the amount of direct memory allocated for large messages.
  See the doc on NettyUtils#DEFAULT_GATHERING for more info.
closes #7811
Aggregations: Significant Terms Heuristics now registered correctly

Closes #7840
Missing file for Sig Terms Heuristics Commit
Add more logging for testSnapshotAndRestore backward compatibility test
[STORE] Improve recovery / snapshot restoring file identity handling

This commit changes the way how files are selected for retransmission
on recovery / restore. Today this happens on a per-file basis where the
rather weak checksum and the file length in bytes is compared to check if
a file is identical. This is prone to fail in the case of a checksum collision
which can happen under certain circumstances.
The changes in this commit move the identity comparsion to a per-commit / per-segment
level where files are only treated as identical iff all the other files in the
commit / segment are the same. This "all or nothing" strategy is reducing the chance for
a collision dramatically since we also use a strong hash to identify commits / segments
based on the content of the ".si" / "segments.N" file.

Closes #7351
[SNAPSHOT] Add BWC layer to .si / segments_N hashing

Due to additional safety added in #7351 we compute now a strong hash for
.si and segments_N files which are compared during snapshot / restore.
Old snapshots don't have this hash which can cause unnecessary copying
of large amount of data. This commit adds the ability to fetch this
hash from the blob store if needed.

Closes #7434
[SNAPSHOT] Ensure BWC layer can read chunked blobs
Use empty BytesRef if we read from <= 1.3.3
[TEST] only bump replicas if we have enough nodes in the cluster
[TEST] only expand to 1 replica in SnapshotBackwardsCompatibilityTest
Use physical name to compare files from snapshot metadata

The comparison and read code in the BlobStoreIndexShardRepository
used the physicalName and Name in reverse order. This caused
SnapshotBackwardsCompatibilityTest to fail.
Adjust inline comments

We backported this feature to 1.3.3 as well so comments should be
updated.
Docs: Typos on range filter

Closes #7713
Docs: Update thrift.asciidoc

Fix typos, add clarifications and link.

Closes #7678
Docs: Update update.asciidoc

Closes #7498
Update upgrade.asciidoc

Fix markup bug and change "deb" to "dpkg". (Package manager called dpkg, not deb in Debian distribution)

Closes #7748
Docs: Mention that that p/c queries and filters do not work in the delete-by-query api.
Update getting-started.asciidoc

zip and tar is archive, deb and rpm is package.

Closes #7749