1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2024-12-14 10:13:05 +02:00
Commit Graph

1360 Commits

Author SHA1 Message Date
David Steele
dabf727d91 Include VM type in gcov path to avoid conflicts between VMs with different architectures. 2018-03-21 16:08:08 -04:00
David Steele
c6457b070f Full branch coverage for config/parse module. 2018-03-21 13:46:08 -04:00
David Steele
b234f43c9d Refactor usec to msec in common/time.c.
The implementation provides usec resolution but this is not needed in practice and it makes the interface more complicated due to the extra zeros.
2018-03-21 09:18:48 -04:00
David Steele
31830bdc55 Full branch coverage for all common/type modules. 2018-03-20 16:08:52 -04:00
David Steele
a2030da200 Specify prefix for lcov output.
This prevents pages from moving around depending on the subtest.
2018-03-20 16:01:38 -04:00
David Steele
f4ed36d128 Add switch() to lcov branch exclusions.
lcov requires default to show complete coverage but --Wswitch-enum enforces all enum values be present so no default is needed.

Add documentation for each branch exclusion.
2018-03-20 10:17:53 -04:00
David Steele
d34142dee8 Update lcov settings.
Mark any coverage less that 100% as yellow, less that 90% as red.

Add comments to config file and make genhtml use it as well as lcov.
2018-03-20 09:47:51 -04:00
David Steele
07f38f584a Use lcov for C unit test coverage reporting.
Switch from Devel::Cover because it would not report on branch coverage for reports converted from gcov.

Branch coverage is not complete, so for the time being errors will only be generated when statement coverage is not complete. Coverage of unit tests is not displayed in the report unless they are incomplete for either statement or branch coverage.
2018-03-19 23:33:28 -04:00
David Steele
2a3d6ecde8 v2.01: Minor Bug Fixes and Improvements
Bug Fixes:

* Fix --target-action and --recovery-option options being reported as invalid when restoring with --type=immediate. (Reported by Brad Nicholson.)
* Immediately error when a secure option (e.g. repo1-s3-key) is passed on the command line. Since pgBackRest would not pass secure options on to sub-processes an obscure error was thrown. The new error is much clearer and provides hints about how to fix the problem. Update command documentation to omit secure options that cannot be specified on the command-line. (Reported by Brad Nicholson.)
* Fix issue passing --no-config to embedded Perl. (Reported by Ibrahim Edib Kokdemir.)
* 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 is no reason for these processes to emit warnings. (Reported by Clinton Adams.)
* Fix manifest test in the check command when tablespaces are present. (Fixed by Cynthia Shang. Reported by Thomas Flatley.)

Improvements:

* Error when multiple arguments are set in the config file for an option that does not accept multiple arguments. (Contributed by Cynthia Shang.)
* Remove extraneous sudo commands from src/Makefile. (Contributed by Adrian Vondendriesch.)
2018-03-19 21:49:41 -04:00
David Steele
45c6a0e864 Remove hard-coded release version from loadTest.c. 2018-03-19 21:03:42 -04:00
David Steele
5b0748cf93 Always autogenerate code if --smart is not specified. 2018-03-19 20:25:55 -04:00
Cynthia Shang
f0a4264f77 Fix manifest test in the check command when tablespaces are present.
Fixed by Cynthia Shang.
Reported by Thomas Flatley.
2018-03-19 19:54:03 -04:00
David Steele
8e9e97728c Remove --smart from --expect tests.
This ensures that new binaries are built before running the tests.
2018-03-19 17:38:44 -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
0c313713b1 Use clang for static code analysis during lint testing.
Nothing found except for some functions that should have been marked __noreturn__.
2018-03-18 13:32:19 -04:00
David Steele
f0451c1494 Enable -Wformat=2 and -Wformat-nonliteral and silence new warnings. 2018-03-15 13:53:03 -04:00
David Steele
8a1ce42c30 Immediately error when a secure option (e.g. repo1-s3-key) is passed on the command line.
Since pgBackRest would not pass secure options on to sub-processes an obscure error was thrown. The new error is much clearer and provides hints about how to fix the problem.

Update command documentation to omit secure options that cannot be specified on the command-line.

Reported by Brad Nicholson.
2018-03-15 12:02:09 -04:00
David Steele
dd3ce70810 Config test code writes secure options to a file instead of passing on the command-line. 2018-03-15 11:09:46 -04:00
David Steele
4fb75c9cc1 Improve conversion of C exceptions to Exception objects.
Colons in the message would prevent all of the message from being loaded into the Exception object.
2018-03-15 11:03:28 -04:00
David Steele
599e291b36 Check int size in common/type.h.
This ensures that integers are at least 32-bits without having to run the test suite.
2018-03-14 14:34:06 -04:00
David Steele
e7fd94ee23 Simplify table of contents on command page by only listing commands.
Suggested by Stephen Frost.
2018-03-14 11:10:46 -04:00
David Steele
4b6cd92a4c Improve debugging.
* Replace remaining NDEBUG blocks with the more granular DEBUG_UNIT.
* Remove some debug memset() calls in MemContext since valgrind is more useful for these checks.
2018-03-12 17:15:14 -04:00
David Steele
cced6ec03a Add ASSERT_DEBUG() macro for debugging.
Replace all current assert() calls except in tests that can't use the debug code.
2018-03-12 14:31:22 -04:00
Cynthia Shang
dd31ae832d Port most of Config::Config::configLoad() from Perl to C.
Contributed by Cynthia Shang.
2018-03-12 11:25:20 -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
94494a632f Update pip before installing awscli. 2018-03-12 11:02:46 -04:00
David Steele
f047cd0dfd Improve code generation performance. 2018-03-09 23:00:20 -05:00
David Steele
b987f05f35 Improve bin and libc build performance. 2018-03-09 21:24:30 -05:00
David Steele
c32ee34612 Build with -DNDEBUG by default but disable for testing. 2018-03-09 18:28:34 -05:00
David Steele
fbe4c40386 Move logic for setting Perl configuration defaults to C. 2018-03-09 09:30:50 -05:00
David Steele
919635b6f4 Set config before Main::main() call to avoid secrets being exposed in a stack trace. 2018-03-08 16:24:16 -05:00
Cynthia Shang
34898ce471 Error when multiple arguments are set in the config file for an option that does not accept multiple arguments.
Contributed by Cynthia Shang.
2018-03-08 14:15:05 -05:00
David Steele
e331564c90 Add new test for Common::Io::Process.
Show that output on stderr will raise an exception on close() even if the exit code is 0.
2018-03-08 12:36:55 -05:00
David Steele
62a9bdbd4c Fix issue passing --no-config to embedded Perl.
Reported by Ibrahim Edib Kokdemir.
2018-03-08 10:43:09 -05: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
4c8ed3530c Show index in examples for indexed options, i.e. repo-*, pg-*.
Suggested by Stephen Frost.
2018-03-06 14:20:12 -05:00
Cynthia Shang
45ffe37e4f Add cfgOptionTest().
Update cfgOption() calls that are better implemented as cfgOptionTest().

Contributed by Cynthia Shang.
2018-03-05 18:51:48 -05:00
David Steele
a50b1eb5be Remove references to the C library being optional. 2018-03-05 10:03:10 -05:00
David Steele
c07aa2ae19 Improve code documentation in config module. 2018-03-02 22:42:02 -05:00
David Steele
406acf9cba Enable -Wconversion and silence new warnings. 2018-03-02 12:07:12 -05:00
Adrian Vondendriesch
6ca6424fb1 Remove extraneous sudo commands from src/Makefile.
Contributed by Adrian Vondendriesch.
2018-03-01 16:59:49 -05:00
David Steele
af805af044 Remove Debian package patch now that it has been merged upstream. 2018-03-01 16:59:13 -05:00
David Steele
5d1722b8ef Disable console display of coverage for C files.
Devel::Cover does not handle it well.
2018-03-01 13:32:51 -05:00
David Steele
57d70a5649 Remove RHEL package patch since upstream has been updated. 2018-03-01 13:31:03 -05:00
David Steele
5b491b3035 Add CentOS/RHEL package builds. 2018-02-26 19:32:27 -05:00
David Steele
f9c1a3b156 Enable -Wswitch-enum and silence new warnings. 2018-02-26 10:43:49 -05:00
David Steele
c8df690931 Fix incorrect enum types in config.c that throw warnings under clang.
Found by Douglas J Hunley.
2018-02-26 10:02:33 -05:00
David Steele
09223a733d Remove github CNAME file. 2018-02-23 23:44:10 -05:00
David Steele
1f954b324a Update how versions are displayed in the documentation. 2018-02-23 23:42:29 -05:00
David Steele
13cdb75ac5 v2.00: Performance Improvements for Archive Push
Features:

* The archive-push command is now partially coded in C which allows the PostgreSQL archive_command to run significantly faster when processing status messages from the asynchronous archive process. (Reviewed by Cynthia Shang.)

Improvements:

* Improve check command to verify that the backup manifest can be built. (Contributed by Cynthia Shang.)
* Improve performance of HTTPS client. Buffering now takes the pending bytes on the socket into account (when present) rather than relying entirely on select(). In some instances the final bytes would not be flushed until the connection was closed.
* Improve S3 delete performance. The constant S3_BATCH_MAX had been replaced with a hard-coded value of 2, probably during testing.
* Allow any non-command-line option to be reset to default on the command-line. This allows options in pgbackrest.conf to be reset to default which reduces the need to write new configuration files for specific needs.
* The C library is now required. This eliminates conditional loading and eases development of new library features.
* The pgbackrest executable is now a C binary instead of Perl. This allows certain time-critical commands (like async archive-push) to run more quickly.
* Rename db-* options to pg-* and backup-* options to repo-* to improve consistency. repo-* options are now indexed although currently only one is allowed.
2018-02-23 22:38:45 -05:00