Remove old payload proxies We no longer need to carry compatibility serialization proxies, remove them. JIRA: CONTROLLER-2057 Change-Id: Ib040c0a082c94383b0224d593ad0ebec951b4d31 Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Switch to use PayloadVersion.CHLORINE_SR2 PayloadVersion.CHLORINE_SR2 is more efficient format, switch to using it and deprecate old versions for removal. JIRA: CONTROLLER-2056 Change-Id: Id05a34a28e4d3e817fc6ff783669493ee80af3b7 Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Add Payload.serializedSize() There is a rather big difference in payload sizing when we consider how big an entry is: in-memory size can easily be "zero", which can translate to a serialized size of hundreds of bytes. This difference is problematic, as we use the former to estimate how many payloads we can squeeze in AppendEntries and we compare that to the configured payload limit. Even when there is some (32KiB by default) cushion, we can end up blowing past the frame size. Add Payload.serializedSize(), which should provide a semi-conservative estimate of serialized size and use that to select the cut-off. Also improve SimpleReplicatedLogEntry's estimates by performing a a quick serialization operation -- which reduces potential waste for each entry by 294 bytes, as our hard-coded estimate of 400 bytes was way too conservative. JIRA: CONTROLLER-2037 Change-Id: I5abe7d00db9e10f1c66e6db0f7c82854f9aa352d 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>
Specify initial serialization buffer capacity for Payloads JFR shows a lot of re-allocations of the backing byte [] when serializing CommitTransactionPayload. Specify a reasonable initial buffer capacity (the default in ByteArrayOutputStream is 32) to reduce re-allocations. This is also configurable via the cfg file (default is 512). Also did the same for the other smaller Payload classes like PurgeTransactionPayload. JIRA: CONTROLLER-1870 Change-Id: I7ebced56812bfc102409b5b2a8b7f4b1b54359fc Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Cleanup warnings - pom.xml groupId duplicate - Futures.addCallback() - Throwables.propagate*() - pontentially-static methods - remove 'throws Exception' where it is not really needed Change-Id: Ib47e6255e0f510ab7dd0dcd08f71f2dd124df7b7 Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
BUG-5280: add frontend state lifecycle When transitioning between roles we need to take care of proper handling of state known about frontend. This patch adds the leader/non-leader transitions, creating the state from FrontendMetadata and forgetting it when transactions are committed. Our replicated log needs to grow more entries to accurately replicate the state of the conversation between the frontend and backend, so if a member becomes the leader it has an understanding of which transactions and transaction chains have been completed (aborted, committed, purged). These are replicated before a response is sent to the frontend, so if a leader before they replicate successfully, the frontend will see them as a timeout and retry them (and be routed to the new leader). Both leader and followers are expected to keep the metadata handy: the leader keeps for the purpose of being able to generate a summarized snapshot. The followers keep it so their metadata view is consistent with the contents of the data tree. Change-Id: I72eea91ee84716cdd8a6a3521b42cca9a9393aff Signed-off-by: Robert Varga <rovarga@cisco.com>