You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Denys Kuzmenko (Jira)" <ji...@apache.org> on 2020/04/20 16:07:00 UTC
[jira] [Updated] (HIVE-20890) ACID: Allow whole table ReadLocks to
skip all partition locks
[ https://issues.apache.org/jira/browse/HIVE-20890?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Denys Kuzmenko updated HIVE-20890:
----------------------------------
Description:
HIVE-19369 proposes adding a EXCL_WRITE lock which does not wait for any SHARED_READ locks for read operations - in the presence of that lock, the insert overwrite no longer takes an exclusive lock.
The only exclusive operation will be a schema change or drop table, which should take an exclusive lock on the entire table directly.
{code}
explain locks select * from tpcds_bin_partitioned_orc_1000.store_sales where ss_sold_date_sk=2452626
+----------------------------------------------------+
| Explain |
+----------------------------------------------------+
| LOCK INFORMATION: |
| tpcds_bin_partitioned_orc_1000.store_sales -> SHARED_READ |
| tpcds_bin_partitioned_orc_1000.store_sales.ss_sold_date_sk=2452626 -> SHARED_READ |
+----------------------------------------------------+
{code}
So the per-partition SHARED_READ locks are no longer necessary, if the lock builder already includes the table-wide SHARED_READ locks.
The removal of entire partitions is the only part which needs to be taken care of within this semantics as row-removal instead of directory removal (i.e "drop partition" -> "truncate partition" and have the truncation trigger a whole directory cleaner, so that the partition disappears when there are 0 rows left).
was:
HIVE-19369 proposes adding a EXCL_WRITE lock which does not wait for any SHARED_READ locks for insert operations - in the presence of that lock, the insert overwrite no longer takes an exclusive lock.
The only exclusive operation will be a schema change or drop table, which should take an exclusive lock on the entire table directly.
{code}
explain locks select * from tpcds_bin_partitioned_orc_1000.store_sales where ss_sold_date_sk=2452626
+----------------------------------------------------+
| Explain |
+----------------------------------------------------+
| LOCK INFORMATION: |
| tpcds_bin_partitioned_orc_1000.store_sales -> SHARED_READ |
| tpcds_bin_partitioned_orc_1000.store_sales.ss_sold_date_sk=2452626 -> SHARED_READ |
+----------------------------------------------------+
{code}
So the per-partition SHARED_READ locks are no longer necessary, if the lock builder already includes the table-wide SHARED_READ locks.
The removal of entire partitions is the only part which needs to be taken care of within this semantics as row-removal instead of directory removal (i.e "drop partition" -> "truncate partition" and have the truncation trigger a whole directory cleaner, so that the partition disappears when there are 0 rows left).
> ACID: Allow whole table ReadLocks to skip all partition locks
> -------------------------------------------------------------
>
> Key: HIVE-20890
> URL: https://issues.apache.org/jira/browse/HIVE-20890
> Project: Hive
> Issue Type: Improvement
> Components: Transactions
> Reporter: Gopal Vijayaraghavan
> Assignee: Zoltan Chovan
> Priority: Major
>
> HIVE-19369 proposes adding a EXCL_WRITE lock which does not wait for any SHARED_READ locks for read operations - in the presence of that lock, the insert overwrite no longer takes an exclusive lock.
> The only exclusive operation will be a schema change or drop table, which should take an exclusive lock on the entire table directly.
> {code}
> explain locks select * from tpcds_bin_partitioned_orc_1000.store_sales where ss_sold_date_sk=2452626
> +----------------------------------------------------+
> | Explain |
> +----------------------------------------------------+
> | LOCK INFORMATION: |
> | tpcds_bin_partitioned_orc_1000.store_sales -> SHARED_READ |
> | tpcds_bin_partitioned_orc_1000.store_sales.ss_sold_date_sk=2452626 -> SHARED_READ |
> +----------------------------------------------------+
> {code}
> So the per-partition SHARED_READ locks are no longer necessary, if the lock builder already includes the table-wide SHARED_READ locks.
> The removal of entire partitions is the only part which needs to be taken care of within this semantics as row-removal instead of directory removal (i.e "drop partition" -> "truncate partition" and have the truncation trigger a whole directory cleaner, so that the partition disappears when there are 0 rows left).
--
This message was sent by Atlassian Jira
(v8.3.4#803005)