You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "Jakov Varenina (Jira)" <ji...@apache.org> on 2021/01/19 12:34:00 UTC

[jira] [Updated] (GEODE-8846) Transaction commit fail when uniqueID integer overflow to negative value

     [ https://issues.apache.org/jira/browse/GEODE-8846?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jakov Varenina updated GEODE-8846:
----------------------------------
    Summary: Transaction commit fail when uniqueID integer overflow to negative value  (was: All subsequent transactions commit actions fail when uniqueID oveflow to negative value)

> Transaction commit fail when uniqueID integer overflow to negative value
> ------------------------------------------------------------------------
>
>                 Key: GEODE-8846
>                 URL: https://issues.apache.org/jira/browse/GEODE-8846
>             Project: Geode
>          Issue Type: Bug
>          Components: client/server
>    Affects Versions: 1.13.0, 1.13.1
>            Reporter: Jakov Varenina
>            Assignee: Jakov Varenina
>            Priority: Major
>
> Client will send negative value when  *uniqId* integer value overflow to negative value (-2147483648):
> {code:java}
> public class TXManagerImpl implements CacheTransactionManager, MembershipListener {
> ...
>   // The unique transaction ID for this Manager
>   private final AtomicInteger uniqId;
> ....
>     TXId id = new TXId(this.distributionMgrId, this.uniqId.incrementAndGet());
> ....
> {code}
> Currently server will interpret all negative values of transactionID(uniqID) as non-transactional traffic. Note that getTransactdionID() actually retrives uniqID that is sent by client.
> {code:java}
> /**
>  * checks to see if this thread needs to masquerade as a transactional thread. clients after
>  * GFE_66 should be able to start a transaction.
>  *
>  * @return true if thread should masquerade as a transactional thread.
>  */
> protected boolean shouldMasqueradeForTx(Message clientMessage,
>     ServerConnection serverConnection) {
>   return serverConnection.getClientVersion().isNotOlderThan(KnownVersion.GFE_66)
>       && clientMessage.getTransactionId() > TXManagerImpl.NOTX; // ---> NOTX is equal -1
> }
> {code}
> After overflow happened all subsequent commit actions from the client will be rejected with exception:
> [vm0] [fatal 2021/01/14 15:28:41.967 CET  <ServerConnection on port 39093 Thread 2> tid=0x52] Server connection from [identity(192.168.90.23(29826:loner):48210:6c694c01,connection=1; port=48212] : Unexpected Error on server
> [vm0] org.apache.geode.InternalGemFireError
> [vm0]     at org.apache.geode.internal.Assert.throwError(Assert.java:91)
> [vm0]     at org.apache.geode.internal.Assert.assertTrue(Assert.java:55)
> [vm0]     at org.apache.geode.internal.cache.tier.sockets.command.CommitCommand.cmdExecute(CommitCommand.java:82)
> [vm0]     at org.apache.geode.internal.cache.tier.sockets.BaseCommand.execute(BaseCommand.java:183)
> [vm0]     at org.apache.geode.internal.cache.tier.sockets.ServerConnection.doNormalMessage(ServerConnection.java:848)
> [vm0]     at org.apache.geode.internal.cache.tier.sockets.OriginalServerConnection.doOneMessage(OriginalServerConnection.java:72)
> [vm0]     at org.apache.geode.internal.cache.tier.sockets.ServerConnection.run(ServerConnection.java:1214)
> [vm0]     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> [vm0]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> [vm0]     at org.apache.geode.internal.cache.tier.sockets.AcceptorImpl.lambda$initializeServerConnectionThreadPool$3(AcceptorImpl.java:691)
> [vm0]     at org.apache.geode.logging.internal.executors.LoggingThreadFactory.lambda$newThread$0(LoggingThreadFactory.java:120)
> [vm0]     at java.lang.Thread.run(Thread.java:748)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)