Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
4.0.0
-
None
Description
With HIVE-21036 we have a way to indicate that a txn is read only.
We should (at least in auto-commit mode) determine if the single stmt is a read and mark the txn accordingly.
Then we can optimize TxnHandler.commitTxn() so that it doesn't do any checks in write_set etc.
TxnHandler.commitTxn() already starts with lockTransactionRecord(stmt, txnid, TXN_OPEN) so it can read the txn type in the same SQL stmt.
HiveOperation only has QUERY, which includes Insert and Select, so this requires figuring out how to determine if a query is a SELECT. By the time Driver.openTransaction(); is called, we have already parsed the query so there should be a way to know if the statement only reads.
For multi-stmt txns (once these are supported) we should allow user to indicate that a txn is read-only and then not allow any statements that can make modifications in this txn. This should be a different jira.
cc ikryvenko
Attachments
Attachments
Issue Links
- depends upon
-
HIVE-22367 Transaction type not retrieved from OpenTxnRequest
- Resolved
- is depended upon by
-
HIVE-21506 Memory based TxnHandler implementation
- Open
- is required by
-
HIVE-21226 Exclude read-only transactions from ValidTxnList
- Closed
-
HIVE-22327 Repl: Ignore read-only transactions in notification log
- Closed
- requires
-
HIVE-21036 extend OpenTxnRequest with transaction type
- Closed
- links to