stampAll
Writes each of stamps over its documents, each by its id (ElasticsearchNames.streamId): _bulk requests of at most maxBatch updates, each guarded in its script, which writes a document that has no ElasticsearchEventIndex.ACCESS_VERSION, one before the stamp's asOf, or asOf with other attributes (a new model's). Returns how many it wrote.
Every write that returned: an update reads its document in real time on its primary, searchable or not, so a stamp writes every stream of its range whose write returned before it began, at
refresh: noneand from any node (#7546). At the store's default refresh it asks for none, which under write load would add a segment a stamp; atimmediate(for tests) each of its requests refreshes, as every write does. A version the index does not hold is passed over (document_missing_exception): its write has not returned, and its record carries the attributes its log held when the Sink read it. An update reaches the alias's write index alone, so a document of another index behind the alias would be passed over as well: see the class.Never older: the Sink writes a document with
createonly, which never replaces one, and an update writes over the document it read, by its sequence number: a document another write changed meanwhile is read and decided again, MAX_STAMP_RUNS times at most, then the stamp fails as transient and its retry writes only what the guard finds still to write. So of two stamps the later wins whatever their order, and two stamps of one document in one request are applied in their order, each under the guard.