[jira] [Commented] (HIVE-12421) Streaming API TransactionBatch.beginNextTransaction() does not wait for locks
[ https://issues.apache.org/jira/browse/HIVE-12421?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15010036#comment-15010036 ] Eugene Koifman commented on HIVE-12421: --- you are right, lock() is a blocking call, so this isn't a problem. > Streaming API TransactionBatch.beginNextTransaction() does not wait for locks > - > > Key: HIVE-12421 > URL: https://issues.apache.org/jira/browse/HIVE-12421 > Project: Hive > Issue Type: Bug > Components: HCatalog, Transactions >Affects Versions: 0.14.0 >Reporter: Eugene Koifman >Assignee: Eugene Koifman > > TransactionBatchImpl.beginNextTransactionImpl() has > {noformat} > LockResponse res = msClient.lock(lockRequest); > if (res.getState() != LockState.ACQUIRED) { > throw new TransactionError("Unable to acquire lock on " + endPt); > } > {noformat} > This means that if there are any competing locks already take, this will > throw an Exception to client. This doesn't seem like the right behavior. It > should block. > We could also add TransactionBatch.beginNextTransaction(long timeoutMs) to > give the client more control. > cc [~alangates] [~sriharsha] -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HIVE-12421) Streaming API TransactionBatch.beginNextTransaction() does not wait for locks
[ https://issues.apache.org/jira/browse/HIVE-12421?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15009724#comment-15009724 ] Roshan Naik commented on HIVE-12421: I think the timeout should be set on the connection object as a property and reused internally on all blocking calls to the backend. .. instead of per method TransactionBatch.beginNextTransaction(long timeoutMs > Streaming API TransactionBatch.beginNextTransaction() does not wait for locks > - > > Key: HIVE-12421 > URL: https://issues.apache.org/jira/browse/HIVE-12421 > Project: Hive > Issue Type: Bug > Components: HCatalog, Transactions >Affects Versions: 0.14.0 >Reporter: Eugene Koifman >Assignee: Eugene Koifman > > TransactionBatchImpl.beginNextTransactionImpl() has > {noformat} > LockResponse res = msClient.lock(lockRequest); > if (res.getState() != LockState.ACQUIRED) { > throw new TransactionError("Unable to acquire lock on " + endPt); > } > {noformat} > This means that if there are any competing locks already take, this will > throw an Exception to client. This doesn't seem like the right behavior. It > should block. > We could also add TransactionBatch.beginNextTransaction(long timeoutMs) to > give the client more control. > cc [~alangates] [~sriharsha] -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HIVE-12421) Streaming API TransactionBatch.beginNextTransaction() does not wait for locks
[ https://issues.apache.org/jira/browse/HIVE-12421?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15009713#comment-15009713 ] Roshan Naik commented on HIVE-12421: I believe msClient.lock( ) itself is a blocking call. The return value check is done as thats the mechanism of the msclient.lock() api to indicate success. It is definitely a good idea to provide a msClient.lock( timeout ) overload for the API to invoke. > Streaming API TransactionBatch.beginNextTransaction() does not wait for locks > - > > Key: HIVE-12421 > URL: https://issues.apache.org/jira/browse/HIVE-12421 > Project: Hive > Issue Type: Bug > Components: HCatalog, Transactions >Affects Versions: 0.14.0 >Reporter: Eugene Koifman >Assignee: Eugene Koifman > > TransactionBatchImpl.beginNextTransactionImpl() has > {noformat} > LockResponse res = msClient.lock(lockRequest); > if (res.getState() != LockState.ACQUIRED) { > throw new TransactionError("Unable to acquire lock on " + endPt); > } > {noformat} > This means that if there are any competing locks already take, this will > throw an Exception to client. This doesn't seem like the right behavior. It > should block. > We could also add TransactionBatch.beginNextTransaction(long timeoutMs) to > give the client more control. > cc [~alangates] [~sriharsha] -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HIVE-12421) Streaming API TransactionBatch.beginNextTransaction() does not wait for locks
[ https://issues.apache.org/jira/browse/HIVE-12421?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15009159#comment-15009159 ] Alan Gates commented on HIVE-12421: --- [~roshan_naik] can comment further, but I think the thinking was some writers have no ability to buffer their inbound data, so blocking on a lock could force them to drop data. We should change this to have the writer pass a maximum wait time. If this code fails to obtain a lock in the allowed time then it can throw an exception that makes clear what happened and let the writer decide what to do from there. > Streaming API TransactionBatch.beginNextTransaction() does not wait for locks > - > > Key: HIVE-12421 > URL: https://issues.apache.org/jira/browse/HIVE-12421 > Project: Hive > Issue Type: Bug > Components: HCatalog, Transactions >Affects Versions: 0.14.0 >Reporter: Eugene Koifman >Assignee: Eugene Koifman > > TransactionBatchImpl.beginNextTransactionImpl() has > {noformat} > LockResponse res = msClient.lock(lockRequest); > if (res.getState() != LockState.ACQUIRED) { > throw new TransactionError("Unable to acquire lock on " + endPt); > } > {noformat} > This means that if there are any competing locks already take, this will > throw an Exception to client. This doesn't seem like the right behavior. It > should block. > We could also add TransactionBatch.beginNextTransaction(long timeoutMs) to > give the client more control. > cc [~alangates] [~sriharsha] -- This message was sent by Atlassian JIRA (v6.3.4#6332)