Bump upstreams Adopt: - yangtools-13.0.1 - mdsal-13.0.0 Also adopts AbstractDOMDataBroker from mdsal-dom-spi, so that we have less code duplication and maintenance. UTs mocking NormalizedNode are updated to ContainerNode, as mocking sealed classes does not work with Mockito (out of the box). Change-Id: I6d3d3c8ced297b6850aea951040d16437df9e3f0 Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Migrate users of Optional.get() We have an incoming enforcement patch, prepare to adopt it. Change-Id: If73abd4ceaea71a216a4bc3a3968b400b508ec38 Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Change RTE to an ISE SpotBugs does not like our throwuign a plain RuntimeException, throw an ISE instead. Change-Id: I1d900144757294df2ebd5b230010cf654372cfcb Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Handle the case when newModification() fails When we are chaining DataTreeModification on top of each other, it is possible that we have an invalid modification, which fails to apply. In that case there is nothing we can do, as we cannot establish a baseline. Handle this case by allocating a specialized modification implementation, which allows close to no interactions. JIRA: CONTROLLER-2039 Change-Id: I9b55da7ccc89c9aeae641a049397d2120e292a9c Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Fail read requests after we have observed a modification failure A local RW transaction can intercept a modification. If this happens, we postpone the failure until commit time, but we must not allow further reads to be satisfied, as they may end up returning incorrect data. JIRA: CONTROLLER-2041 Change-Id: Ic1bb4c33b786e5926022125be8ee66aebfafee87 Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Do not use NPE for consistency checks We are using Preconditions.checkNotNull() when guarding against illegal state. Improve this by using verifyNotNull(), which results in VerifyException, making the intent clearer. Also migrate a verify(foo != null) to a proper verifyNotNull(), using the resoluting value. Change-Id: I2689852d396315714f126743b70469ceef75ce45 Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Expose CursorAwareDataTreeSnapshot from local RW proxy We can improve type safety a bit by exposing the fact the backing snapshot supports cursors. Change-Id: If65549d6a28851c0abd1c8b826e48503ef12860c Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Bump upstream SNAPSHOTS Adopt: - odlparent-10.0.0 - yangtools-8.0.0-SNAPSHOT - mdsal-9.0.0-SNAPSHOT Change-Id: I60991718a6d1ef6f108c2b1f7b2c09b0c5f973c4 Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Handle ModifyTransactionRequest in forward path When we have remote -> local handoff, we will use a ModifyTransactionRequest, which we need to apply before moving on. JIRA: CONTROLLER-2022 Change-Id: I04bdfda162d474966b153223c7480fd5b3af8099 Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Bump odlparent/yangtools/mdsal Adopt latest versions, namely; - odlparent-9.0.1 - yangtools-7.0.1 - mdsal-8.0.0-SNAPSHOT There are a few adjustments needed, which mostly deal with the interface to NormalizedNode. Change-Id: I918fb885a6df62e16e17119a7e04ba1672ef7c39 Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Use OptionalLong to track enqueue time This prevents the need to box/unbox primitive longs and makes things generally more convenient. Change-Id: I6ca394526b09fdd469a9440c9313371e6185c135 Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Bump odlparent to 5.0.0 This bumps odlparent references to 5.0.0, removing use of the JSR305 remnants. Also a useless javadoc plugin override is removed. Change-Id: Iae5355e49115afdd73b60bd26ac85f7f542bbff8 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>
Migrate to use openCursor() createCursor() has been deprecated long time ago, use its replacement instead. Change-Id: Id8862470ca4ad8c9fdec5c05cbac044c6715e153 Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Do not assert seal transition on forward path Unlike the replay path, where we expect no successor, the forward path may very well encounter a successor being present. Move the assertion to replay path only, as that is where it catches issues. The forward path automatically propagates the seal via its use of sendRequest(), which is forwarded as needed and therefore we only note the race via LOG.debug() and not assert it. Change-Id: I6f95acc49800d456c049d19982c801015fd69420 JIRA: CONTROLLER-1885 Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Adjust to mdsal DOM read/exists FluentFuture change This patch needs to be coordinated with https://git.opendaylight.org/gerrit/#/c/74127/. Change-Id: Iceeff9f9f75ca40ebc31bd839b5e6a5c8639aa4c Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Fix sonar warnings in sal-distributed-datastore These come from squid: - String literals should not be duplicated - Modifiers should be declared in the correct order - Lambdas and anonymous classes should not have too many lines - Nested blocks of code should not be left empty - Local variables should not shadow class fields - Exception handlers should preserve the original exception - Utility classes should not have public constructors - Overriding methods should do more than simply call the same method in the super class - Unused private fields should be removed I fixed quite a few of them. Others we'd have to suppress or modify the sonar config to be more lenient. Change-Id: I7ce7b2a05feac9844fd9c37927de82b7b8b68ee5 Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
BUG-8618: rework AbstractProxyTransaction.flushState() Instead of directly forwarding state use ModifyTransactionRequest to encapsulate state and forward it separately to the successor. This eliminates sendRequest() from replay path, ensuring the replay thread is not blocked. Change-Id: Ice86791d417b7487b9d3b1df06341dd028cde7f8 Signed-off-by: Robert Varga <robert.varga@pantheon.tech> (cherry picked from commit c525e5f25b951daa28d0cbde237ba3040b68f99f)
Fix Verify/Preconditions string format These methods take a String.format() string, not a logging one, hence we are not getting the information we want. Change-Id: I46de0d64c85594e3d7b8be97951f1cf5249bca8f Signed-off-by: Robert Varga <robert.varga@pantheon.tech> (cherry picked from commit 3e9ac68fea1aef0c7fedec346e50882efdde8acc)
BUG-8704: rework seal mechanics to not wait during replay AbstractProxyTransaction.seal() and most notably internalSeal() can end up pushing down messages down the connection hence they can end up slowing down the replay process. The replay paths end up enqueing subsequent requests anyway, so rework the structure to split the 'seal only' and 'seal and flush' codepaths. Change-Id: Ie75c1ef8aa0d3d5d7ca482d383fd516077ca50b4 Signed-off-by: Robert Varga <robert.varga@pantheon.tech> (cherry picked from commit 1e07329c0d800b8fea43ae0c4060aded5fd18739)