You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by Rajesh Balamohan <ra...@gmail.com> on 2016/08/08 08:38:26 UTC

Review Request 50888: Reduce number of partition check calls in add_partitions

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/50888/
-----------------------------------------------------------

Review request for hive and Ashutosh Chauhan.


Bugs: HIVE-14462
    https://issues.apache.org/jira/browse/HIVE-14462


Repository: hive-git


Description
-------

Metastore already does all the validations. Lots of MS calls are made just before add_partitions to double check if the partitions exists.  This impacts perf when large number of partitions are present.


Diffs
-----

  metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java 38c0eed 

Diff: https://reviews.apache.org/r/50888/diff/


Testing
-------


Thanks,

Rajesh Balamohan


Re: Review Request 50888: Reduce number of partition check calls in add_partitions

Posted by Rajesh Balamohan <ra...@gmail.com>.

> On Aug. 24, 2016, 3:44 p.m., Ashutosh Chauhan wrote:
> > ql/src/java/org/apache/hadoop/hive/ql/metadata/HiveMetaStoreChecker.java, line 368
> > <https://reviews.apache.org/r/50888/diff/5/?file=1483535#file1483535line368>
> >
> >     We should throw only if hive.msck.path.validation is configured to throw.

Added this info to WARN message.


- Rajesh


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/50888/#review146669
-----------------------------------------------------------


On Aug. 24, 2016, 11:22 p.m., Rajesh Balamohan wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/50888/
> -----------------------------------------------------------
> 
> (Updated Aug. 24, 2016, 11:22 p.m.)
> 
> 
> Review request for hive and Ashutosh Chauhan.
> 
> 
> Bugs: HIVE-14462
>     https://issues.apache.org/jira/browse/HIVE-14462
> 
> 
> Repository: hive-git
> 
> 
> Description
> -------
> 
> Metastore already does all the validations. Lots of MS calls are made just before add_partitions to double check if the partitions exists.  This impacts perf when large number of partitions are present.
> 
> 
> Diffs
> -----
> 
>   metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java 3f85ca6 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java a59b781 
>   ql/src/java/org/apache/hadoop/hive/ql/metadata/CheckResult.java ec9deeb 
>   ql/src/java/org/apache/hadoop/hive/ql/metadata/HiveMetaStoreChecker.java 34b76b8 
>   ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHiveMetaStoreChecker.java 3f26bcd 
> 
> Diff: https://reviews.apache.org/r/50888/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Rajesh Balamohan
> 
>


Re: Review Request 50888: Reduce number of partition check calls in add_partitions

Posted by Ashutosh Chauhan <ha...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/50888/#review146669
-----------------------------------------------------------




metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java 
<https://reviews.apache.org/r/50888/#comment213232>

    startAddPartition() also has check for  MetaStoreUtils.validatePartitionNameCharacters();
    which I think is useful. So, instead of completely removing startAddPartition, we may want to retain this check.



ql/src/java/org/apache/hadoop/hive/ql/metadata/HiveMetaStoreChecker.java 
<https://reviews.apache.org/r/50888/#comment213236>

    Can you add info level log message about sizes of these 4 sets. Aids in debugging.



ql/src/java/org/apache/hadoop/hive/ql/metadata/HiveMetaStoreChecker.java (line 363)
<https://reviews.apache.org/r/50888/#comment213234>

    We should throw only if hive.msck.path.validation is configured to throw.


- Ashutosh Chauhan


On Aug. 24, 2016, 8:04 a.m., Rajesh Balamohan wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/50888/
> -----------------------------------------------------------
> 
> (Updated Aug. 24, 2016, 8:04 a.m.)
> 
> 
> Review request for hive and Ashutosh Chauhan.
> 
> 
> Bugs: HIVE-14462
>     https://issues.apache.org/jira/browse/HIVE-14462
> 
> 
> Repository: hive-git
> 
> 
> Description
> -------
> 
> Metastore already does all the validations. Lots of MS calls are made just before add_partitions to double check if the partitions exists.  This impacts perf when large number of partitions are present.
> 
> 
> Diffs
> -----
> 
>   metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java 3f85ca6 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java a59b781 
>   ql/src/java/org/apache/hadoop/hive/ql/metadata/CheckResult.java ec9deeb 
>   ql/src/java/org/apache/hadoop/hive/ql/metadata/HiveMetaStoreChecker.java 34b76b8 
>   ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHiveMetaStoreChecker.java 3f26bcd 
> 
> Diff: https://reviews.apache.org/r/50888/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Rajesh Balamohan
> 
>


Re: Review Request 50888: Reduce number of partition check calls in add_partitions

Posted by Rajesh Balamohan <ra...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/50888/
-----------------------------------------------------------

(Updated Aug. 24, 2016, 11:22 p.m.)


Review request for hive and Ashutosh Chauhan.


Changes
-------

Addressing review comments


Bugs: HIVE-14462
    https://issues.apache.org/jira/browse/HIVE-14462


Repository: hive-git


Description
-------

Metastore already does all the validations. Lots of MS calls are made just before add_partitions to double check if the partitions exists.  This impacts perf when large number of partitions are present.


Diffs (updated)
-----

  metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java 3f85ca6 
  ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java a59b781 
  ql/src/java/org/apache/hadoop/hive/ql/metadata/CheckResult.java ec9deeb 
  ql/src/java/org/apache/hadoop/hive/ql/metadata/HiveMetaStoreChecker.java 34b76b8 
  ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHiveMetaStoreChecker.java 3f26bcd 

Diff: https://reviews.apache.org/r/50888/diff/


Testing
-------


Thanks,

Rajesh Balamohan


Re: Review Request 50888: Reduce number of partition check calls in add_partitions

Posted by Rajesh Balamohan <ra...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/50888/
-----------------------------------------------------------

(Updated Aug. 24, 2016, 8:04 a.m.)


Review request for hive and Ashutosh Chauhan.


Changes
-------

Rebasing as HIVE-14511 got committed.


Bugs: HIVE-14462
    https://issues.apache.org/jira/browse/HIVE-14462


Repository: hive-git


Description
-------

Metastore already does all the validations. Lots of MS calls are made just before add_partitions to double check if the partitions exists.  This impacts perf when large number of partitions are present.


Diffs (updated)
-----

  metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java 3f85ca6 
  ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java a59b781 
  ql/src/java/org/apache/hadoop/hive/ql/metadata/CheckResult.java ec9deeb 
  ql/src/java/org/apache/hadoop/hive/ql/metadata/HiveMetaStoreChecker.java 34b76b8 
  ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHiveMetaStoreChecker.java 3f26bcd 

Diff: https://reviews.apache.org/r/50888/diff/


Testing
-------


Thanks,

Rajesh Balamohan


Re: Review Request 50888: Reduce number of partition check calls in add_partitions

Posted by Rajesh Balamohan <ra...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/50888/
-----------------------------------------------------------

(Updated Aug. 23, 2016, 5:04 a.m.)


Review request for hive and Ashutosh Chauhan.


Bugs: HIVE-14462
    https://issues.apache.org/jira/browse/HIVE-14462


Repository: hive-git


Description
-------

Metastore already does all the validations. Lots of MS calls are made just before add_partitions to double check if the partitions exists.  This impacts perf when large number of partitions are present.


Diffs (updated)
-----

  metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java 3f85ca6 
  ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java a59b781 
  ql/src/java/org/apache/hadoop/hive/ql/metadata/CheckResult.java ec9deeb 
  ql/src/java/org/apache/hadoop/hive/ql/metadata/HiveMetaStoreChecker.java a164b12 
  ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHiveMetaStoreChecker.java 5b8ec60 

Diff: https://reviews.apache.org/r/50888/diff/


Testing
-------


Thanks,

Rajesh Balamohan


Re: Review Request 50888: Reduce number of partition check calls in add_partitions

Posted by Rajesh Balamohan <ra...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/50888/
-----------------------------------------------------------

(Updated Aug. 10, 2016, 10:50 a.m.)


Review request for hive and Ashutosh Chauhan.


Changes
-------

In some corner cases, it is possible that partitions can have nested & multiple directories. (e.g table/ii=1/jj=15/q=10/r=20/s=30/000000_0, table/ii=1/jj=15/q=11/r=22/s=33/000000_0 where in ii and jj are the only partition columns).
{{HiveMetastoreChecker.getPartitionName}} ends up resolving partition names as "ii=1/jj=15/q=11/r=22/s=33" and "ii=1/jj=15/q=10/r=20/s=30".  
When msck is run, it would end up throwing duplicate partitions exception for ii=1, jj=15 in MS. msck falls back to {{msckAddPartitionsOneByOne}}, which 
tries to repair one partition at a time and ignores any exceptions. So job completes essentially, but ends up making lots of calls to MS and can be too slow. I will attach the latest patch in RB

Without Patch:
=============
msck runtime for 10000 partitions in small cluster: *370 seconds*

With Patch:
===========
msck runtime for 10000 partitions in small cluster: *62 seconds*


Bugs: HIVE-14462
    https://issues.apache.org/jira/browse/HIVE-14462


Repository: hive-git


Description
-------

Metastore already does all the validations. Lots of MS calls are made just before add_partitions to double check if the partitions exists.  This impacts perf when large number of partitions are present.


Diffs (updated)
-----

  metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java 38c0eed 
  ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java a59b781 
  ql/src/java/org/apache/hadoop/hive/ql/metadata/CheckResult.java ec9deeb 
  ql/src/java/org/apache/hadoop/hive/ql/metadata/HiveMetaStoreChecker.java a164b12 
  ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHiveMetaStoreChecker.java 5b8ec60 

Diff: https://reviews.apache.org/r/50888/diff/


Testing
-------


Thanks,

Rajesh Balamohan


Re: Review Request 50888: Reduce number of partition check calls in add_partitions

Posted by Rajesh Balamohan <ra...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/50888/
-----------------------------------------------------------

(Updated Aug. 9, 2016, 12:22 a.m.)


Review request for hive and Ashutosh Chauhan.


Changes
-------

addedPartitions.put() was needed so that it can be rolledback on need basis.


Bugs: HIVE-14462
    https://issues.apache.org/jira/browse/HIVE-14462


Repository: hive-git


Description
-------

Metastore already does all the validations. Lots of MS calls are made just before add_partitions to double check if the partitions exists.  This impacts perf when large number of partitions are present.


Diffs (updated)
-----

  metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java 38c0eed 

Diff: https://reviews.apache.org/r/50888/diff/


Testing
-------


Thanks,

Rajesh Balamohan


Re: Review Request 50888: Reduce number of partition check calls in add_partitions

Posted by Ashutosh Chauhan <ha...@apache.org>.

> On Aug. 8, 2016, 6:10 p.m., Sergey Shelukhin wrote:
> > metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java, line 2491
> > <https://reviews.apache.org/r/50888/diff/1/?file=1466073#file1466073line2491>
> >
> >     this check is needed, it only checks against the list itself

Can you explain why this is needed?


- Ashutosh


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/50888/#review145122
-----------------------------------------------------------


On Aug. 8, 2016, 8:38 a.m., Rajesh Balamohan wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/50888/
> -----------------------------------------------------------
> 
> (Updated Aug. 8, 2016, 8:38 a.m.)
> 
> 
> Review request for hive and Ashutosh Chauhan.
> 
> 
> Bugs: HIVE-14462
>     https://issues.apache.org/jira/browse/HIVE-14462
> 
> 
> Repository: hive-git
> 
> 
> Description
> -------
> 
> Metastore already does all the validations. Lots of MS calls are made just before add_partitions to double check if the partitions exists.  This impacts perf when large number of partitions are present.
> 
> 
> Diffs
> -----
> 
>   metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java 38c0eed 
> 
> Diff: https://reviews.apache.org/r/50888/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Rajesh Balamohan
> 
>


Re: Review Request 50888: Reduce number of partition check calls in add_partitions

Posted by Sergey Shelukhin <se...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/50888/#review145122
-----------------------------------------------------------




metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java 
<https://reviews.apache.org/r/50888/#comment211301>

    this check is needed, it only checks against the list itself


- Sergey Shelukhin


On Aug. 8, 2016, 8:38 a.m., Rajesh Balamohan wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/50888/
> -----------------------------------------------------------
> 
> (Updated Aug. 8, 2016, 8:38 a.m.)
> 
> 
> Review request for hive and Ashutosh Chauhan.
> 
> 
> Bugs: HIVE-14462
>     https://issues.apache.org/jira/browse/HIVE-14462
> 
> 
> Repository: hive-git
> 
> 
> Description
> -------
> 
> Metastore already does all the validations. Lots of MS calls are made just before add_partitions to double check if the partitions exists.  This impacts perf when large number of partitions are present.
> 
> 
> Diffs
> -----
> 
>   metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java 38c0eed 
> 
> Diff: https://reviews.apache.org/r/50888/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Rajesh Balamohan
> 
>