Implement scatter/gather on module shards ClientBackedDatastore does perform module shard root scatter/gather, hence reads of root end up talking to only the default shard. Refactor the scatter/gather logic from DistributedDatastore into a common component and use it for both modes of operation. JIRA: CONTROLLER-2038 Change-Id: Ib04efab46e36e512eb89606d026fd2082de1b693 Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Track skipped transactions We are allocating transaction identifiers which are shared across shards. As a transaction can touch only some shards, non-participating shards will never see the transaction ID, leading to holes in their UnsignedLongSets -- and those holes gradually eat up more and more memory. Track when we have such a hole and lazily forward a new request, which purges one or more such identifiers -- plugging the memory leak. The crux of the machinery is exchanging state between ProxyHistory and FrontendHistoryMetadataBuilder. JIRA: CONTROLLER-1991 Change-Id: I3817fa2841e5f9c405bb20ff1a104537ad459ce3 Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Minor sal-distributed-datastore cleanups Corrent a @GuardedBy annotations, add @NonNull annotations, fix javadocs and make a few methods final. Change-Id: Icb93aae229fb0aece5ece223a759ce9f36ee0297 Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Correct annotations Correct @GuardedBy vs @Holding and add @NonNull annotations. Change-Id: I2142b1c5910f2388e8f30a04f7ff8bc8237dde26 Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Use java.lang.ref.Cleaner for ClientBackedTransaction Improve temporary file clean up by using a Cleaner to dispatch cleaning tasks. Since it gives us a Cleanable, we can dispense with a tracking map and removal from it -- Cleanable makes sure it is called exactly once. JIRA: CONTROLLER-1911 Change-Id: I02d2ee57a9fada2c54ba06008b6c28681a709748 Signed-off-by: tadei.bilan <tadei.bilan@pantheon.tech> Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Refactor AbstractClientHandle a bit We can pull the proxy creation method down into the subclass, making it simpler to follow. Change-Id: I0d025ace708a0646fb0c7dc49fc3f819453b90e5 Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Fix modernization issues This fixes issues pointed out by Modernizer, which mostly boil down to using Objects.requireNonNull() and direct java.util collections. Change-Id: Id32530a6722cd101f96c23f6a745f91b2f09e2f9 Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Migrate nullness annotations This mass-migrates sal-distributed-datastore to use JDT nullness annotations instead of JSR305. Change-Id: I2cd739e3db8c074a55e335e17297a23065775d6a Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Improve orphan transaction logging This patch improves logging when we perform last-resort cleanup from garbage collector, so that the type of client handle is also logged. This allows us to discern snapshots and snapshots. Also lower the logging level to INFO, as this is something that should be fixed by whoever is causing it, but it does not pose serious threat to stability. Change-Id: Iad55c49de87ca73f9671f04f569be7eae0e4f885 Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Unit tests for ClientBackedTransactionChain class Change-Id: I97953cfdc32619c31295cfed2584b7466d48aa5d Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
BUG-5280: add basic concept of ClientSnapshot In order to accurately read-only transactions with ClientLocalHistory, we need to differentiate between Transactions and Snapshots. This patch introduces the concept, its API and backend signalling/implementation. State keeping is reworked so it requires only a single field, which is manipulated via an atonic updater, with null signifying state has already been closed (or is in process of being taken care of). Change-Id: I2f8fd5ffdff366d1948538299b96721b756c620c Signed-off-by: Robert Varga <rovarga@cisco.com>