Skip to content

Commit

Permalink
Added LIMIT_PARTITION_REQUEST_NUMBER variable to protect metastore ab…
Browse files Browse the repository at this point in the history
…use (#113)

* Added LIMIT_PARTITION_REQUEST_NUMBER variable to protect metastore abuse

* changelog
  • Loading branch information
javsanbel2 committed Jun 28, 2023
1 parent 24a3e00 commit db2fe10
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [3.0.10] - 2023-06-28
### Added
- Added variable `LIMIT_PARTITION_REQUEST_NUMBER` to protect the cluster, this controls how many partitions can be scanned for each partitioned table. The default value "-1" means no limit. The limit on partitions does not affect metadata-only queries.

## [3.0.9] - 2022-11-23
### Added
- Variable `MYSQL_SECRET_USERNAME_KEY` for pulling aws credentials where the key is set to something other than `username`. Defaults to `username`.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ For more information please refer to the main [Apiary](https://github.com/Expedi
|GLUE_PREFIX|No|Prefix added to Glue databases to handle database name collisions when synchronizing multiple Hive Metastores to the Glue catalog.|
|HADOOP_HEAPSIZE|No|Hive Metastore Java process heapsize.|
|HMS_AUTOGATHER_STATS|No (default is `true`)|Whether or not to create basic statistics on table/partition creation. Valid values are `true` or `false`.|
|LIMIT_PARTITION_REQUEST_NUMBER|No (default is `-1`)|To protect the cluster, this controls how many partitions can be scanned for each partitioned table. The default value "-1" means no limit. The limit on partitions does not affect metadata-only queries.|
|HIVE_METASTORE_ACCESS_MODE|No|Hive Metastore access mode, applicable values are: readwrite, readonly|
|HIVE_DB_NAMES|No|comma separated list of Hive database names, when specified Hive databases will be created and mapped to corresponding S3 buckets.|
|HIVE_METASTORE_LOG_LEVEL|No|Hive Metastore service Log4j log level.|
Expand Down
13 changes: 9 additions & 4 deletions files/hive-site.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
<value>true</value>
</property>

<property>
<name>datanucleus.connectionPool.maxPoolSize</name>
<value>10</value>
</property>
<property>
<name>datanucleus.connectionPool.maxPoolSize</name>
<value>10</value>
</property>

<property>
<name>hive.metastore.uris</name>
Expand Down Expand Up @@ -98,4 +98,9 @@
<value>true</value>
</property>

<property>
<name>hive.metastore.limit.partition.request</name>
<value>-1</value>
</property>

</configuration>
4 changes: 4 additions & 0 deletions files/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ if [[ -n ${HMS_AUTOGATHER_STATS} ]]; then
update_property.py hive.stats.autogather "${HMS_AUTOGATHER_STATS}" /etc/hive/conf/hive-site.xml
fi

if [[ -n ${LIMIT_PARTITION_REQUEST_NUMBER} ]]; then
update_property.py hive.metastore.limit.partition.request "${LIMIT_PARTITION_REQUEST_NUMBER}" /etc/hive/conf/hive-site.xml
fi

#configure LDAP group mapping, required for ranger authorization
if [[ -n $LDAP_URL ]] ; then
if [[ -n $LDAP_SECRET_ARN ]] ; then
Expand Down

0 comments on commit db2fe10

Please sign in to comment.