Skip to content

Add documentation for db resource group manager#4523

Closed
phd3 wants to merge 1 commit intotrinodb:masterfrom
phd3:docs
Closed

Add documentation for db resource group manager#4523
phd3 wants to merge 1 commit intotrinodb:masterfrom
phd3:docs

Conversation

@phd3
Copy link
Copy Markdown
Member

@phd3 phd3 commented Jul 21, 2020

Fixes #4450

@cla-bot cla-bot bot added the cla-signed label Jul 21, 2020
@phd3 phd3 requested a review from raghavsethi July 21, 2020 17:38
@martint martint requested a review from mosabua July 22, 2020 02:48
* ``resource-groups.config-file``: a JSON file storing the configurations, which can be an absolute
path, or a path relative to the Presto data directory.

Db Resource Group Manager
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Db Resource Group Manager
Database Resource Group Manager

Might Database instead of Db be more descriptive?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Database resource group manager

* ``resource-groups.max-refresh-interval``: Time period for which the cluster will continue to accept
queries after refresh failures cause configuration to become stale. The default is ``1h``.
* ``resource-groups.exact-match-selector-enabled``: Boolean flag to enable usage of a selector requiring
an exact match of environment, source and query type.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the default value for DbResourceGroupConfig.exactMatchSelectorEnabled implicitly set false, should we put the default value here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes ... also this needs to be explained more.. maybe with an example.

Add an ``etc/resource-groups.properties`` file with the following contents to enable
the built-in manager that reads a JSON config file:

There are two built-in managers: file-based and database-based. Add an ``etc/resource-groups.properties``
Copy link
Copy Markdown
Member

@mosabua mosabua Jul 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use a file-based or a database-based resource group manager:

  • Add a file etc/resource-groups.properties
  • Set the resource-groups.configuration-manager property to file or db
  • Add further configuration properties for the the desired manager.

There are two built-in managers: file-based and database-based. Add an ``etc/resource-groups.properties``
file with the appropriate configurations to enable one of the two managers.

File Resource Group Manager
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

File resource group manager

File Resource Group Manager
---------------------------

This manager reads the resource group configuration from a JSON config file.
Copy link
Copy Markdown
Member

@mosabua mosabua Jul 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file resource group manager reads a JSON configuration file, specified with resource-groups.config-file


Change the value of ``resource-groups.config-file`` to point to a JSON config file,
which can be an absolute path, or a path relative to the Presto data directory.
* ``resource-groups.config-file``: a JSON file storing the configurations, which can be an absolute
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The path to the JSON file can be an absolute path, or a path relative to the Presto data directory.

which can be an absolute path, or a path relative to the Presto data directory.
* ``resource-groups.config-file``: a JSON file storing the configurations, which can be an absolute
path, or a path relative to the Presto data directory.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also does this file need to be on the coordinator and all workers?

.. literalinclude:: resource-groups-example.json
:language: json

Providing Selector Properties
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Providing selector properties


.. _global-properties:

Global Properties
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Global propertie


.. _selector-rules:

Selector Rules
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Selector rules

Db Resource Group Manager
-------------------------

This manager periodically loads the resource group configuration from a database.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The database resource group manager loads the configuration from a relational database.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to doc which ones are supported.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only MySQL is supported at the moment. It does mean it should work with MariaDB too but I'm not sure.

.. code-block:: none

resource-groups.configuration-manager=db
resource-groups.config-db-url=jdbc:mysql://localhost:3306/config_db?user=presto_admin
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which databases are supported? How do users get JDBC driver in place?

resource-groups.max-refresh-interval=1m
resource-groups.exact-match-selector-enabled=true

* ``resource-groups.config-db-url`` (required): Database URL to load configuration from.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

specify more details about this JDBC URL

resource-groups.exact-match-selector-enabled=true

* ``resource-groups.config-db-url`` (required): Database URL to load configuration from.
* ``resource-groups.max-refresh-interval``: Time period for which the cluster will continue to accept
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thats a odd name for what it does. Anyway .. remove future usage . otherwise ok

resource-groups.max-refresh-interval=1m
resource-groups.exact-match-selector-enabled=true

* ``resource-groups.config-db-url`` (required): Database URL to load configuration from.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All properties in the following section require quite a bit more docs so I would suggest to remove usage of a bullet lest and just document them in multiple paragraphs one after the other.

is used for loading exact-match based selectors. If any of the tables do not exist, Presto creates them
on server startup.

+---------------------+-------------------------------------------------------+---------------------------------+
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is way too much info for a table. I suggest we break this up into a separate section with proper code blocks and paragraphs that details more info.

* ``resource-groups.exact-match-selector-enabled``: Boolean flag to enable usage of a selector requiring
an exact match of environment, source and query type.

The configuration is loaded every second from the following tables under the specified db url. If the
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The paragraph and following table needs to be broken up and reordered

  • First startup and automatic table creation
  • Document each table maybe with example row of data (including additional table for exact-match)
  • Document how we suggest users add data to the table (maybe example insert statement, update statement), also should they do that from Presto via catalog, or some other SQL UI directly on the db (probably that)
  • How it works (refresh interval...)

Copy link
Copy Markdown
Member

@mosabua mosabua left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Various updates and clarifications needed.

@posulliv
Copy link
Copy Markdown
Contributor

@phd3 do you mind if I create a new PR to update these docs by rebasing from your branch? I've made some updates in this area and want to document them.

@phd3
Copy link
Copy Markdown
Member Author

phd3 commented Jan 24, 2022

please go ahead @posulliv , thanks for picking this up.

@posulliv
Copy link
Copy Markdown
Contributor

thanks @phd3!

I opened a new PR with a branch off your commit and it has some of the feedback from here applied.

@posulliv posulliv closed this Jan 24, 2022
@posulliv
Copy link
Copy Markdown
Contributor

This is the PR I opened - #10771

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

Add documentation for DB based ResourceGroup Managers

5 participants