David Steele
6fd0c3dcaa
Improved lock implementation written in C.
...
Now only two types of locks can be taken: archive and backup. Most commands use one or the other but the stanza-* commands acquire both locks. This provides better protection than the old command-based locking scheme.
2018-04-11 09:36:12 -04:00
David Steele
2c1687721e
Fix issue where specifying log-level-stderr > warn would cause a local/remote process to error on exit due to output found on stderr when none was expected.
...
The max value for a local/remote process is now error since there's no reason for these processes to emit warnings.
Reported by Clinton Adams.
2018-03-19 13:08:42 -04:00
David Steele
03f1082e86
Improve logging.
...
Move command begin to C except when it must be called after another command in Perl (e.g. expire after backup). Command begin logs correctly for complex data types like hash and list. Specify which commands will log to file immediately and set the default log level for log messages that are common to all commands. File logging is initiated from C.
2018-03-12 11:03:38 -04:00
David Steele
5e0ce3e996
Fix --target-action and --recovery-option options being reported as invalid when restoring with --type=immediate.
...
Reported by Brad Nicholson.
2018-03-06 17:12:16 -05:00
David Steele
64a7196cb6
Rename retention-* options to repo-retention-*.
2018-02-19 15:07:24 -05:00
Cynthia Shang
4352407777
Option rename cleanup based on review.
...
* Remove --reset tags from v1 options.
* Use constants for repo prefix.
* Specify CFGDEF_INDEX_PG in option structure rather than adding in code.
* Fix error message references to "backup host".
Contributed by Cynthia Shang.
2018-02-19 10:12:51 -05:00
David Steele
72cbb9a9d4
Call Perl with built-in interpreter instead of execvp().
...
Exec'ing Perl worked fine but generated a very large command line in the process list and potentially exposed secrets.
2018-02-14 17:19:54 -05:00
Cynthia Shang
00e9aca872
Fixed issue where --reset-* was not passing the default value to Perl.
...
Contributed by Cynthia Shang.
2018-02-13 15:58:14 -05:00
David Steele
ea296372d4
Add allow range to int/float options that did not already have one.
2018-02-09 15:42:11 -05:00
David Steele
7c58fe7451
Use 64-bit integers for config options.
...
In particular, archive-queue-max requires a greater range than is provided by a 32-bit integer.
2018-02-09 13:54:33 -05:00
David Steele
7d13087c4b
Rename -no to -reset for non-boolean options.
2018-02-06 11:26:06 -05:00
David Steele
d35757c05f
Fix missing log-level-stderr option for stanza-* commands.
2018-02-05 15:19:28 -05:00
David Steele
db21b7a360
Cleanup usage of internal options.
...
Apply internal to options that need to be read to determine locality but should not appear in the help.
2018-02-05 11:50:09 -05:00
David Steele
be90028100
Rename db-* options to pg-* and backup-* options to repo-* to improve consistency.
...
* repo-* options are now indexed although only one is allowed.
* List deprecated option names in documentation and command-line help.
2018-02-03 18:27:38 -05:00
David Steele
b58a45e067
Implement help command in C.
2018-01-23 13:34:24 -05:00
David Steele
3dd882a79e
Add internal flag to config definition.
2018-01-23 12:49:04 -05:00
David Steele
bffc6c49b3
Add perl-bin option to specify the Perl binary location when /usr/bin/env perl won't work.
2018-01-16 13:23:08 -05:00
Cynthia Shang
0e9ba98a50
Add stanza-delete command to cleanup unused stanzas.
...
Contributed by Cynthia Shang.
2018-01-03 12:23:33 -05:00
David Steele
526acca5bd
Config parsing implemented in C.
2017-12-22 23:27:49 -05:00
David Steele
99a0721631
Allow any non-boolean, non-command-line option to be negated.
...
This allows specific options in pgbackrest.conf to be ignored (and set to default) which reduces the need to write new configuration files for specific needs.
Note that boolean, non-command-line options are already negatable.
2017-12-05 15:23:32 -05:00
David Steele
c5fc88d340
Fixed an issue that suppressed locality errors for backup and restore.
...
When a backup host is present, backups should only be allowed on the backup host and restores should only be allowed on the database host unless an alternate configuration is created that ignores the remote host.
Reported by Lardière Sébastien.
2017-12-05 14:59:09 -05:00
David Steele
5eb5d94d65
Allow internal options that do not show up in the documentation.
...
Used for test options initially but other use cases are on the horizon.
2017-12-05 14:46:52 -05:00
David Steele
8d4674031e
More config parsing in C in preparation for all config parsing in C.
2017-12-05 10:09:07 -05:00
David Steele
4f1725dc36
Replace cfgCommandTotal()/cfgOptionTotal() functions with constants.
...
The constants are applicable in more cases and allow the compiler to optimize certain loops more efficiently.
2017-12-05 09:45:51 -05:00
David Steele
915ae5662a
Implement version command in C.
2017-11-28 21:44:05 -05:00
David Steele
2ed426a70b
Remove deprecated archive-max-mb option.
2017-11-27 20:43:44 -05:00
David Steele
7cf955425e
The C library is now required.
...
This eliminates conditional loading and eases development of new library features.
2017-11-26 17:45:00 -05:00
David Steele
ac542788da
Convert configuration definitions from auto-generated functions to auto-generated data structures.
2017-11-02 08:14:13 -04:00
David Steele
55f68ef013
Remove configurable option hints.
...
db-path was the only option with a hint so the feature seemed wasteful. All missing stanza options now output the same hint without needing configuration.
2017-10-30 10:58:04 -04:00
David Steele
1ef27ec8c2
Add list type for options.
...
The hash type was being used for lists with an additional flag (`value-hash`) to indicate that it was not really a hash.
2017-10-30 10:50:35 -04:00
David Steele
8efcc38304
Improvements in C codebase:
...
* Update C naming conventions.
* Use int datatype wherever possible.
* Better separation of C source from Perl interface.
2017-09-30 10:44:03 -04:00
David Steele
1e0ed07455
Configuration rules are now pulled from the C library when present.
2017-08-25 16:47:47 -04:00