Add documentation for db resource group manager#4523
Add documentation for db resource group manager#4523phd3 wants to merge 1 commit intotrinodb:masterfrom
Conversation
| * ``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 |
There was a problem hiding this comment.
| Db Resource Group Manager | |
| Database Resource Group Manager |
Might Database instead of Db be more descriptive?
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
As the default value for DbResourceGroupConfig.exactMatchSelectorEnabled implicitly set false, should we put the default value here?
There was a problem hiding this comment.
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`` |
There was a problem hiding this comment.
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-managerproperty tofileordb - 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 |
| File Resource Group Manager | ||
| --------------------------- | ||
|
|
||
| This manager reads the resource group configuration from a JSON config file. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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. | ||
|
|
There was a problem hiding this comment.
Also does this file need to be on the coordinator and all workers?
| .. literalinclude:: resource-groups-example.json | ||
| :language: json | ||
|
|
||
| Providing Selector Properties |
|
|
||
| .. _global-properties: | ||
|
|
||
| Global Properties |
|
|
||
| .. _selector-rules: | ||
|
|
||
| Selector Rules |
| Db Resource Group Manager | ||
| ------------------------- | ||
|
|
||
| This manager periodically loads the resource group configuration from a database. |
There was a problem hiding this comment.
The database resource group manager loads the configuration from a relational database.
There was a problem hiding this comment.
Need to doc which ones are supported.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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. | ||
|
|
||
| +---------------------+-------------------------------------------------------+---------------------------------+ |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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...)
mosabua
left a comment
There was a problem hiding this comment.
Various updates and clarifications needed.
|
@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. |
|
please go ahead @posulliv , thanks for picking this up. |
|
thanks @phd3! I opened a new PR with a branch off your commit and it has some of the feedback from here applied. |
|
This is the PR I opened - #10771 |
Fixes #4450