Terracotta-OSS / terracotta-platform

http://terracotta.org
Apache License 2.0
32 stars 48 forks source link

TDB-5385: Add missing requirements and defaults for startup script options #1018

Closed mathieucarbou closed 3 years ago

mathieucarbou commented 3 years ago

This PR adds the missing requirement and defaults for each option for the node startup script.

CLI tools already have these things, they were missing from the startup script.

BEFORE

    -audit-log-dir              security audit log directory
    -authc                      security authentication setting (file|ldap|certificate)
    -auto-activate              automatically activate the node so that it becomes active or joins a stripe (true|false)
    -backup-dir                 node backup directory
    -bind-address               node bind address for port
    -client-lease-duration      client lease duration
    -client-reconnect-window    client reconnect window
    -cluster-name               cluster name
    -config-dir                 node configuration directory
    -config-file                configuration properties file
    -data-dirs                  data directory
    -failover-priority          failover priority setting (availability|consistency)
    -group-bind-address         node bind address for group port
    -group-port                 node port used for intra-stripe communication
    -help                       provide usage information
    -hostname                   node host name
    -log-dir                    node log directory
    -metadata-dir               node metadata directory
    -name                       node name
    -offheap-resources          offheap resources
    -port                       node port
    -public-hostname            public node host name
    -public-port                public node port
    -repair-mode                node repair mode (true|false)
    -security-dir               security root directory
    -ssl-tls                    ssl-tls setting (true|false)
    -stripe-name                stripe name
    -tc-properties              tc-properties
    -whitelist                  security whitelist (true|false)

AFTER

    -audit-log-dir              Security audit log directory. Default: <unset>
    -authc                      Security authentication setting (file|ldap|certificate). Default: <unset>
    -auto-activate              Automatically activate the node so that it becomes active or joins a stripe
    -backup-dir                 Node backup directory. Default: <unset>
    -bind-address               Node bind address for node port. Default: 0.0.0.0
    -client-lease-duration      Client lease duration. Default: 150s
    -client-reconnect-window    Client reconnect window. Default: 120s
    -cluster-name               Cluster name. Default: <unset>
    -config-dir                 Node configuration directory. Default: %H/terracotta/config
    -config-file                Configuration file to load
    -data-dirs                  Data directories. Default: main:%H/terracotta/user-data/main
    -failover-priority          Failover priority setting (availability|consistency), required with more than 1 node. Default: <unset>
    -group-bind-address         Node bind address for group port. Default: 0.0.0.0
    -group-port                 Node port used for intra-stripe communication. Default: 9430
    -help                       Command-line help
    -hostname                   Node host name. Default: %h
    -log-dir                    Node log directory. Default: %H/terracotta/logs
    -metadata-dir               Node metadata directory. Default: %H/terracotta/metadata
    -name                       Node name. Default: <generated>
    -offheap-resources          Off-heap resources. Default: main:512MB
    -port                       Node port. Default: 9410
    -public-hostname            Public node host name. Default: <unset>
    -public-port                Public node port. Default: <unset>
    -repair-mode                Start node in repair mode
    -security-dir               Security root directory. Default: <unset>
    -ssl-tls                    SSL/TLS setting (true|false). Default: false
    -stripe-name                Stripe name. Default: <generated>
    -tc-properties              Node properties. Default: <unset>
    -whitelist                  Security whitelist (true|false). Default: false
GaryWKeim commented 3 years ago

If something has a Default value, should it also be Required?

mathieucarbou commented 3 years ago

If something has a Default value, should it also be Required?

Not always: i.e. offheap and data dirs are not required, could be empty, but by default a value is there so that a node can be started and used with some defaults.

But re-reading it again, I have updated the PR to simplify

GaryWKeim commented 3 years ago

If something has a Default value, should it also be Required?

Not always: i.e. offheap and data dirs are not required, could be empty, but by default a value is there so that a node can be started and used with some defaults.

But re-reading it again, I have updated the PR to simplify

I guess I'm trying to say that it isn't Required to be specified on the CLI if it has a Default, correct? So the definition of Required here seems off. Is it required to be specified or that it have a value?

mathieucarbou commented 3 years ago

If something has a Default value, should it also be Required?

Not always: i.e. offheap and data dirs are not required, could be empty, but by default a value is there so that a node can be started and used with some defaults. But re-reading it again, I have updated the PR to simplify

I guess I'm trying to say that it isn't Required to be specified on the CLI if it has a Default, correct? So the definition of Required here seems off. Is it required to be specified or that it have a value?

Oh I see! Yes that wording it bad because it matches what's required for the system to work, but does not indicate to the user what is required in the CLI !

I think we could remove complete optional and required!

mathieucarbou commented 3 years ago

If something has a Default value, should it also be Required?

Not always: i.e. offheap and data dirs are not required, could be empty, but by default a value is there so that a node can be started and used with some defaults. But re-reading it again, I have updated the PR to simplify

I guess I'm trying to say that it isn't Required to be specified on the CLI if it has a Default, correct? So the definition of Required here seems off. Is it required to be specified or that it have a value?

Oh I see! Yes that wording it bad because it matches what's required for the system to work, but does not indicate to the user what is required in the CLI !

I think we could remove complete optional and required!

@GaryWKeim : here is a new proposal (PR description updated).

If it works for you, you can merge.