@Stability.Internal public class LostCleanupDistributed extends Object
The user specifies that lost transactions should be found inside a certain cleanup window of X seconds.
As this algo is distributed and tries to require minimal co-operation between clients (they simply read and write a Client Record doc periodically, there are flaws including:
Two clients can read the same client record at the same time and miss each other's updates A client can read the record just before a new client removes itself
The idea is that these conflicts will sort themselves out on the next iteration, and that in the vast majority of cases each ATR will be checked in X seconds.
Constructor and Description |
---|
LostCleanupDistributed(Core core,
CoreTransactionsConfig config,
Supplier<TransactionsCleaner> cleanerSupplier) |
Modifier and Type | Method and Description |
---|---|
void |
addToCleanupSet(CollectionIdentifier coll) |
Set<CollectionIdentifier> |
cleanupSet() |
Flux<TransactionCleanupAttemptEvent> |
handleATRCleanup(String bp,
CollectionIdentifier atrCollection,
String atrId,
ActiveTransactionRecordStats stats,
Duration safetyMargin,
SpanWrapper pspan)
Looks at an ATR, finds any expired entries, and cleans them up.
|
Mono<Void> |
shutdown(Duration timeout) |
public LostCleanupDistributed(Core core, CoreTransactionsConfig config, Supplier<TransactionsCleaner> cleanerSupplier)
public void addToCleanupSet(CollectionIdentifier coll)
public Set<CollectionIdentifier> cleanupSet()
public Flux<TransactionCleanupAttemptEvent> handleATRCleanup(String bp, CollectionIdentifier atrCollection, String atrId, ActiveTransactionRecordStats stats, Duration safetyMargin, SpanWrapper pspan)
Copyright © 2024 Couchbase, Inc.. All rights reserved.