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

980 Commits

Author SHA1 Message Date
David Steele
91622942c2 Create test matrix for mock/archive-stop to increase coverage and reduce tests.
The same test configurations are run on all four test VMs, which seems a real waste of resources.

Vary the tests per VM to increase coverage while reducing the total number of tests. Be sure to include each major feature (remote, s3, encryption) in each VM at least once.
2019-03-01 17:12:41 +02:00
David Steele
c307d9fdf9 Don't make a copy of the context name in the MemContext module.
This is very inefficient in terms of memory and time and dynamic context names were never utilized.

Just require that context names be valid for the life of the context.

In practice they are all static strings.
2019-03-01 15:58:52 +02:00
David Steele
90709dfd21 Improve performance of context and memory allocations in MemContext module.
Allocations required a sequential scan through the allocation list for both contexts and memory.  This was very inefficient since for the most part individual memory allocations are seldom freed directly, rather they are freed when their context is freed.

For both types of allocations track an index for the lowest free position.  After an allocation of the free position, a sequential search will be required for the next allocation but this is still far better than doing a scan for every allocation.

With a moderately-sized dataset (500 history entries in backup.info), there is a 237X performance improvement when combined with the f74e88bb refactor.

Before:

  %   cumulative   self
 time   seconds   seconds name
 65.11    331.37   331.37 memContextAlloc
 16.19    413.78    82.40 memContextCurrent
 14.74    488.81    75.03 memContextTop
  2.65    502.29    13.48 memContextNewIndex
  1.18    508.31     6.02 memFind

After:

  %   cumulative   self
 time   seconds   seconds name
 94.69      2.14     2.14 memFind

Finding memory allocations in order to free or resize them is the next bottleneck, but this does not seem to be a major issue presently.
2019-03-01 14:57:01 +02:00
David Steele
f74e88bba9 Use contextTop/contextCurrent instead of memContextTop()/memContextCurrent() in MemContext module.
Using the functions internally is great for abstraction but not so great for performance on non-optimized builds.

Also, the functions end up prominent in any profiled build.
2019-03-01 13:33:58 +02:00
David Steele
6ce3310f8a Update default documentation version to PostgreSQL 10.
Also update CentOS 6 and 7 versions to PostgreSQL 9.5 and 9.6 respectively.
2019-03-01 09:10:14 +02:00
David Steele
4093609241 Documentation builds on PostgreSQL 9.4-10.
More than likely 9.2-11 will work as well, but this has not been tested.

However, 11 needs work on the group permissions introduced in that version.
2019-03-01 09:00:51 +02:00
Marc Cousin
cb3b4fa24b Enable socket keep-alive on older Perl versions.
The prior method depended on IO:Socket:SSL to push the keep-alive options down to the socket but it only worked for recent versions of the module.

Instead, create the socket directly using IO::Socket::IP if available or IO:Socket:INET as a fallback.  The keep-alive option is set directly on the socket before it is passed to IO:Socket:SSL.

Contributed by Marc Cousin.
2019-02-28 14:33:29 +02:00
David Steele
db4b447be8 The archive-get command is implemented entirely in C.
This new implementation should behave exactly like the old Perl code with the exception of a few updated log messages.

Remove as much of the Perl code as possible without breaking other commands.
2019-02-27 23:03:02 +02:00
David Steele
9367cc461c Migrate local command to C.
The C local is only used for C commands in the main process.

Some tweaking of the existing protocolGet() command was required. Originally the idea was to share the function for local and remote requests but the differences (as in Perl) were too great to make that practical.
2019-02-27 22:34:21 +02:00
David Steele
35abd4cd95 Add ProtocolParallel* objects for parallelizing commands.
Allows commands to be easily parallelized if the jobs are broken up into discrete, non-overlapping chunks.
2019-02-27 21:10:52 +02:00
David Steele
35acfae7c2 Add ProtocolCommand object.
This formalizes the creation of protocol commands, which was previously done by creating KeyValue objects manually.
2019-02-27 19:48:30 +02:00
David Steele
dee90d3e60 Expose handle (file descriptor) from IoRead when applicable.
Some IO objects have file descriptors which can be useful for monitoring with select().

It might also be useful to expose handles for write objects but there is currently no use case.
2019-02-27 18:11:09 +02:00
David Steele
b1957b07f3 Improve null-handling of varToLog(). 2019-02-27 18:10:18 +02:00
David Steele
ea2aef1d0c Add lstRemove() to List object.
Because it is sometimes useful to remove items from a list.
2019-02-27 18:09:21 +02:00
David Steele
4be271ea2a Improve fork harness to allow multiple children and setup pipes automatically.
There was a lot of extra boilerplate involved in setting up pipes so that is now automated.

In some cases testing with multiple children is useful so allow that as well.
2019-02-27 18:07:16 +02:00
David Steele
18b62a4220 Only run test-level stack trace by default for unit-tested modules.
This amends 70c30dfb which disabled test tracing in general.

Instead, only enable test tracing by default for modules that are being unit tested. This saves lots of time but still ensures that test tracing is working and helps with debugging in unit tests.

Also rename the option to --debug-test-trace for a clarity.
2019-02-27 17:09:19 +02:00
David Steele
3a05359087 Create test matrix for mock/stanza to increase coverage and reduce tests.
The same test configurations are run on all four test VMs, which seems a real waste of resources.

Vary the tests per VM to increase coverage while reducing the total number of tests. Be sure to include each major feature (remote, s3, encryption) in each VM at least once.
2019-02-24 07:42:41 +02:00
David Steele
6d3e18b181 Reduce expect log level in mock/stanza tests.
The expect tests were originally a rough-and-ready type of unit test so monitoring changes in the expect log helped us detect changes in behavior.

Now the stanza code is heavily unit-tested so the detailed logs mainly cause churn and don't have any measurable benefit.

Reduce the log level to DETAIL to make the logs less verbose and volatile, yet still check user-facing log messages.
2019-02-24 06:55:59 +02:00
David Steele
2f081f3ec7 Rename test modules for consistency.
The conventions for command and info tests have shifted in the C modules, though not even all the C modules got the message.
2019-02-23 18:51:52 +02:00
David Steele
d489eb87f7 Create test matrix for mock/archive to increase coverage and reduce tests.
The same test configurations are run on all four test VMs, which seems a real waste of resources.

Vary the tests per VM to increase coverage while reducing the total number of tests.  Be sure to include each major feature (remote, s3, encryption) in each VM at least once.
2019-02-23 15:59:39 +02:00
David Steele
4a7588e604 Create aliases for test VMs ordered by age.
This will allow for smarter allocation of tests in the next commit.
2019-02-23 15:13:23 +02:00
David Steele
59d7958914 Reduce expect log level in mock/archive tests.
The expect tests were originally a rough-and-ready type of unit test so monitoring changes in the expect log helped us detect changes in behavior.

Now the archive code is heavily unit-tested so the detailed logs mainly cause churn and don't have any measurable benefit.

Reduce the log level to DETAIL to make the logs less verbose and volatile, yet still check user-facing log messages.
2019-02-23 15:05:06 +02:00
David Steele
a9cbf23f4c Improve error when hostname cannot be found in a certificate.
Update error message with the hostname and more detail about what went wrong.  Hopefully this will help in diagnosing certificate/hostname issues.

Suggested by James Badger.
2019-02-23 07:28:27 +02:00
David Steele
1f66bda02e Fix non-compliant JSON for options passed from C to Perl.
We have been using a hacked-up JSON generator to pass options from C to Perl since the C binary was introduced.  This generator was not very compliant which led to issues with \n, ", etc. inside strings.

We have a fully-compliant JSON generator now so use that instead.

Reported by Leo Khomenko.
2019-02-22 12:02:26 +02:00
David Steele
70c30dfb61 Disable test-level stack trace by default.
Detailed stack traces for low-level functions (e.g. strCat, bufMove) can be very useful for debugging but leaving them on for all tests has become quite burdensome in terms of time.  Complex operations like generating JSON on a large KevValue can lead to timeouts even with generous values.

Add a new param, --debug-trace, to enable test-level stack trace, but leave it off by default.
2019-02-22 11:40:30 +02:00
David Steele
ae86e6d5b2 Add missing ToLog() coverage to String, List, and PgControl.
Missing coverage is exposed in the next commit which disables test tracing by default.
2019-02-22 11:31:37 +02:00
David Steele
a7c8906581 Fix incorrect tags. 2019-02-21 18:49:02 +02:00
David Steele
b1eb8af7d5 Resolve storage path expressions before passing to remote.
Expressions such as <REPO:ARCHIVE> require a stanza name in order to be resolved correctly.  However, if the stanza name is passed to the remote then that remote will only work correctly for that one stanza.

Instead, resolved the expressions locally but still pass a relative path to the remote.  That way, a storage path that is only configured on the remote does not need to be known locally.
2019-02-21 15:40:21 +02:00
David Steele
b4d4680f8c Allow cfgExecParam() to exclude options.
It is useful to be able to exclude an option even if it is shared by both commands.
2019-02-21 14:40:35 +02:00
David Steele
be6a3f131e Improve null-handling of strToLog().
NULL was returning {"(null)"} which was comprehensible but not very pretty.  Instead return null on NULL.
2019-02-21 14:26:06 +02:00
David Steele
1fd89f05af Add kvKeyExists() to KeyValue object.
Check if a key exists even if the value is NULL, which is the same result for a missing key.
2019-02-21 14:16:17 +02:00
Stefan Fercot
80df1114bd Fix info command missing WAL min/max when stanza specified.
This issue was a result of STORAGE_REPO_PATH prepending an extra stanza when the stanza was specified on the command line.

The tests missed this because by some strange coincidence the WAL dirs were empty for each test that specified a stanza.  Add new tests to prevent a regression.

Fixed by Stefan Fercot.
2019-02-21 12:09:12 +02:00
David Steele
1519f5b045 Add storageHelperFree() to storage helper.
Free all cached objects in the storage helper, especially the stanza name.

This clears the storage environment for tests that switch stanza names or go from a stanza name to no stanza name or vice versa. This is only useful for testing right now, but may be used in the future for commands than act on multiple stanzas.
2019-02-21 11:40:30 +02:00
David Steele
b0b5989aca Migrate remote archive-get command to C.
All required protocol commands are implemented so this is mostly a matter of enabling the feature and updating expect logs.
2019-02-20 22:57:18 +02:00
David Steele
6866ff031a Add exists() to remote storage. 2019-02-20 22:43:02 +02:00
David Steele
71bc5697b1 Increase per-call stack trace size to 4096.
This was previously 256, which was too small to log protocol parameters.  Not only did this truncate important debug information but varying path lengths caused spurious differences in the expect logs.
2019-02-20 22:23:19 +02:00
David Steele
73be64ce49 Add separate archive-get-async command.
This command was previously forked off from the archive-get command which required a bit of artificial option and log manipulation.

A separate command is easier to test and will work on platforms that don't have fork(), e.g. Windows.
2019-02-20 15:52:07 +02:00
David Steele
e48b406cdc Add instructions for building the coverage report.
These are intended to be temporary until a fully automated report is developed.

Since we don't know when that will happen, at least make it easier to generate the current report.
2019-02-20 15:48:14 +02:00
David Steele
da628be8a8 Migrate remote command to C.
Prior to this the Perl remote was used to satisfy C requests. This worked fine but since the remote needed to be migrated to C anyway there was no reason to wait.

Add the ProtocolServer object and tweak ProtocolClient to work with it. It was also necessary to add a mechanism to get option values from the remote so that encryption settings could be read and used in the storage object.

Update the remote storage objects to comply with the protocol changes and add the storage protocol handler.

Ideally this commit would have been broken up into smaller chunks but there are cross-dependencies in the protocol layer and it didn't seem worth the extra effort.
2019-02-19 20:57:38 +02:00
David Steele
d211c2b8b5 Fix possible truncated WAL segments when an error occurs mid-write.
The file write object destructors called close() and finalized the file even if it was not completely written.  This was an issue in both the C and Perl code.

Rewrite the destructors to simply free resources (like file handles) rather than calling the close() method.  This leaves the temp file in place for filesystems that use temp files.

Add unit tests to prevent regression.

Reported by blogh.
2019-02-15 11:52:39 +02:00
Stephen Frost
2cd204f380 Change execRead() to return a size_t.
execRead() should be returning a size_t, not a void. Thankfully, this isn't actually used and therefore shouldn't be an issue, but we should fix it anyway.

Contributed by Stephen Frost.
2019-02-12 14:59:51 +02:00
David Steele
a5f6f801d7 Begin v2.11 development. 2019-02-12 14:11:16 +02:00
David Steele
35903b94d9 v2.10: Bug Fixes
Bug Fixes:

* Add unimplemented S3 driver method required for archive-get. (Reported by mibiio.)
* Fix check for improperly configured pg-path. (Reported by James Chanco Jr.)
2019-02-09 19:52:31 +02:00
David Steele
51971617a8 Fix year on 2.09 release.
Reported by Achilleas Mantzios.
2019-02-09 19:01:16 +02:00
David Steele
057e2e2782 Add unimplemented S3 driver method required for archive-get.
This was not being caught because the integration tests for S3 were running remotely and going through the Perl code rather than the new C code.

Implement the exists method for the S3 driver and add tests to prevent a regression.

Reported by mibiio.
2019-02-09 18:57:30 +02:00
David Steele
6e88f93991 Fix check for improperly configured pg-path.
The check to verify that pg-path and data_directory are equal was not working because pg-path was getting overwritten with data_directory before validation took place.

Reported by James Chanco Jr.
2019-02-05 18:55:07 +02:00
David Steele
be8f31a952 JSON improvements.
Optimize the parser implementation and make the renderer more null tolerant.

Also make some string and variant constructors null tolerant.
2019-02-05 15:34:18 +02:00
David Steele
b29a8dd9c5 Automatically adjust db-timeout when protocol-timeout is smaller.
This already worked in reverse, but this case is needed when a command that only uses protocol-timeout (e.g. info) calls a remote process where protocol-timeout and db-timeout can be set.  If protocol-timeout was set to less than the default db-timeout then an error resulted.
2019-02-02 15:03:19 +02:00
David Steele
abc613b454 Begin v2.10 development. 2019-02-02 14:50:24 +02:00
David Steele
a89a376119 v2.09: Minor Improvements and Bug Fixes
Bug Fixes:

* Fix issue with multiple async status files causing a hard error. (Reported by Vidhya Gurumoorthi, Joe Ayers, Douglas J Hunley.)

Improvements:

* The info command is implemented entirely in C.
* Simplify info command text message when no stanzas are present by replacing the repository path with "the repository".
* Add _DARWIN_C_SOURCE flag to Makefile for MacOS builds. (Contributed by Douglas J Hunley.)
* Update address lookup in C TLS client to use modern methods. (Suggested by Bruno Friedmann.)
* Include Posix-compliant header for strcasecmp() and fd_set. (Suggested by ucando.)
2019-01-30 22:37:35 +02:00
David Steele
aa3e5b8c72 Allow primary gid for the test user to be different from uid.
Apparently up until now they have always been the same, which is pretty typical.  However, if they were not then ContainerTest.pm was not happy.
2019-01-30 17:03:17 +02:00
David Steele
711b3e67cb Add examples for building a documentation host. 2019-01-30 16:53:59 +02:00
David Steele
dada50ee26 Fix hard-coded repository path.
This prevented packages from being passed to the documentation unless they were in the /backrest directory on the host.

Also make the local path /pgbackrest instead of the deprecated /backrest.

Reported by Heath Lord.
2019-01-30 13:39:22 +02:00
David Steele
8634eb8c43 Include Posix-compliant header for fd_set.
Similar to f3ae3c4f, add Posix-compliant header to make FreeBSD happy.

Suggested by ucando.
2019-01-29 12:08:14 +02:00
David Steele
b5a103f2df Improve P/PP type macro handling.
Rather than create _P/_PP variants for every type that needs to pass/return pointers, create FUNCTION_*_P/PP() macros that will properly pass or return any single/double pointer types.

There remain a few unresolved edge cases such as CHARPY but this handles the majority of types well.
2019-01-28 22:33:29 +02:00
David Steele
8b2a344cfe Remove unused type parameter from FUNCTION_TEST_RETURN().
This parameter was always useless but commit 7333b630 removed all references to it so remove the parameter at all call sites as well.

The original intention was probably to allow logging of TEST return values but that never happened.
2019-01-28 15:06:28 +02:00
David Steele
7333b6302f Improve CONST type macro handling.
Rather than create a CONST_ variant for every type that needs to be returned const, create a FUNCTION_LOG_RETURN_CONST() macro that will return any type as const.
2019-01-28 09:44:10 +02:00
David Steele
d29aa61286 Allocate extra space for concatenations in the String object.
The string object was reallocating memory with every concatenation which is not very efficient.  This is especially true for JSON rendering which does a lot of concatenations.

Instead allocate a pool of extra memory on the first concatenation (50% of size) to be used for future concatenations and reallocate when needed.

Also add a 1GB size limit to ensure that there are no overflows.
2019-01-27 11:50:09 +02:00
David Steele
82c2d615b3 Move MACRO_TO_STR() to common/debug.h.
This macro is handy for constructing static message strings so move it where the core code can see it.
2019-01-27 11:34:12 +02:00
David Steele
4027123ef1 Update contributor name. 2019-01-27 08:01:17 +02:00
David Steele
8f6d324b2c Fix issue with multiple async status files causing a hard error.
Multiple status files were being created by asynchronous archiving if a high-level error occurred after one or more WAL segments had already been transferred successfully.  Error files were being written for every file in the queue regardless of whether it had already succeeded.  To fix this, add an option to skip writing error files when an ok file already exists.

There are other situations where both files might exist (various fsync and filesystem error scenarios) so it seems best to retry in the case that multiple status files are found rather than throwing a hard error (which then means that archiving is completely stuck).  In the case of multiple status files, a warning will be logged to alert the user that something unusual is happening and the command will be retried.

Reported by fpa-postgres, Joe Ayers, Douglas J Hunley.
2019-01-26 16:59:54 +02:00
David Steele
f3ae3c4f9d Include Posix-compliant header for strcasecmp().
gcc has apparently merged this function in string.h but Posix specifies that it should be in strings.h.  FreeBSD at at least is sticking to the standard.

In the long run it might be better to implement our own strcasecmp() function but for now just add the header.

Suggested by ucando.
2019-01-26 13:48:46 +02:00
David Steele
1401c023f0 Fix release note typo. 2019-01-26 12:02:48 +02:00
David Steele
053972bfe0 Update address lookup in C TLS client to use modern methods.
The implementation using gethostbyname() was only intended to be used during prototyping but was forgotten when the code was finalized.

Replace it with gettaddrinfo() which is more modern and supports IPv6.

Suggested by Bruno Friedmann.
2019-01-26 12:01:18 +02:00
David Steele
4d1060ea6b Replace FileOpenError with HostConnectError in TlsClient.
HostConnectError is more appropriate in this context.
2019-01-26 10:39:51 +02:00
David Steele
33d39d248c Allow if condition in documentation lists and list items. 2019-01-24 16:45:28 +02:00
David Steele
bec52b6f41 Allow if in manifest variables.
The code supported this feature but the manifest DTD did now allow it.
2019-01-24 11:11:12 +02:00
David Steele
db08656537 Rename FUNCTION_DEBUG_* and consolidate ASSERT_* macros for consistency.
Rename FUNCTION_DEBUG_* macros to FUNCTION_LOG_* to more accurately reflect what they do.  Further rename FUNCTION_DEBUG_RESULT* macros to FUNCTION_LOG_RETURN* to make it clearer that they return from the function as well as logging.  Leave FUNCTION_TEST_* macros as they are.

Consolidate the various ASSERT* macros into a single ASSERT macro that is always compiled out of production builds.  It was difficult to figure out when an assert would be checked with all the different types in play.  When ASSERTs are compiled in they will always be checked regardless of the log level -- tying these two concepts together was not a good idea.
2019-01-21 17:41:59 +02:00
David Steele
d245f8eb42 The info command is implemented entirely in C.
The C info code has already been committed but this commit wires it into main.

Also remove the info Perl code and tests since they are no longer called.
2019-01-21 13:51:45 +02:00
David Steele
f79af47bd4 Increase timeout in storage/s3 module to improve reliability. 2019-01-19 20:44:40 +02:00
David Steele
e57f1b5293 Fix escaping in JSON string parser. 2019-01-19 12:57:40 +02:00
David Steele
7355248d6b Add remote storage objects.
This is a partial implementation of remote storage with just enough functionality to get the info command working.  The client is written in C but the server is still in Perl, which limits progress until a C server is written.
2019-01-18 22:04:37 +02:00
David Steele
88201f37a3 Add ProtocolClient object and helper functions.
This is a complete protocol client implementation in C.

Currently there is no C server implementation so the C client is talking to a Perl server.  This won't work very long, though, as the protocol format, even though in JSON, has a lot of language-specific structure.  While it would be possible to maintain compatibility between C and Perl it's probably not worth the effort in the long run.

Just as in Perl there are helper functions to make constructing protocol objects easier.  Currently only repository remotes are supported.
2019-01-18 21:32:51 +02:00
David Steele
9cac403f61 Add Exec object.
Executes a child process and allows the calling process to communicate with it using read/write io.

This object is specially tailored to implement the protocol layer and may or may not be generally applicable to general purpose
execution.
2019-01-18 11:45:40 +02:00
David Steele
797f8098d1 Add ioReadBuf() to easily read into a buffer.
Moves some boilerplate into a function and makes it easier to get coverage in cases where a single buffer read captures all the data.
2019-01-18 11:14:44 +02:00
David Steele
06d41b4dc0 Add cfgExecParam() to generate parameters for executing commands.
Parameters for the local/remote commands are based on parameters that are passed to the current command.

Generate parameters for the new command based on the intersection of parameters between the current command and the command to be executed.
2019-01-17 22:29:19 +02:00
David Steele
ecd56105e6 Add IoHandleRead and IoHandleWrite objects.
General i/o objects for reading and writing file descriptors, in particular those that can block.  In other words, these are not generally to be used with file descriptors for actual files, but rather pipes, sockets, etc.
2019-01-17 22:08:31 +02:00
David Steele
bf0c41d9d6 Add const VariantList * debug type. 2019-01-16 22:23:25 +02:00
David Steele
e68d1e7304 Simplify info command text message when no stanza are present.
Replace the repository path with just "the repository".  The path is not important in this context and it is clearer to state where the stanzas are missing from.
2019-01-16 19:23:10 +02:00
David Steele
ef9dc89e08 Update Storage::Local->list() to accept an undefined path.
The Perl code has a tendency to generate absolute paths even when they are not needed. This change helps the C and Perl storage work together via the protocol layer.
2019-01-16 18:49:12 +02:00
David Steele
b4146b6bff Update Perl repo rules to work when stanza is not specified.
The C storage object strives to use rules whenever possible instead of generating absolute paths.  This change helps the C and Perl storage work together via the protocol layer.
2019-01-16 18:45:19 +02:00
David Steele
0014e15944 Fix escaping in JSON string renderer. 2019-01-16 18:34:50 +02:00
David Steele
c0a9048536 Fix null output in JSON renderer.
In some cases nulls were being rendered as "(null)" because no special logic existed to handle them.
2019-01-16 09:11:01 +02:00
David Steele
ec26a0594e Allow string Variant objects to contain null.
This is more useful than the variant itself being null as it saves conditionals when creating.
2019-01-16 09:05:13 +02:00
David Steele
1b334da87f Add kvMove() and varLstMove().
Allow these objects to be moved to another mem context.
2019-01-14 22:02:23 +02:00
David Steele
aab9e38b9a Return UnknownError from errorTypeFromCode() for invalid error codes.
The prior behavior was to throw an exception but this was not very helpful when something unexpected happened.  Better to at least emit the error message even if the error code is not very helpful.
2019-01-14 21:34:22 +02:00
David Steele
2b02d37602 Allow empty arrays in JSON parser. 2019-01-14 21:21:37 +02:00
David Steele
8304d452b3 Make the C version of the info command conform to the Perl version.
There were some small differences in ordering and how the C version handled missing directories.  It may be that the C version is more consistent, but for now it is more important to be compatible with the Perl version.

These differences were missed because the C info command was not wired into main.c so it was not being tested in regression.  This commit does not fix the wiring issue because there will likely be a release soon and it is too big a change to put in at the last moment.
2019-01-13 22:44:58 +02:00
David Steele
f314a1f8aa Improve accuracy of strSizeFormat().
Casting to int caused large values to be slightly inaccurate so cast to uint64_t instead.

Also, use multiplication where possible since the compiler should precompute multiplied values.
2019-01-13 22:22:15 +02:00
David Steele
cebcb3f027 Null-terminate list returned by strLstPtr().
The null-terminator is required by many C functions that accept a string list so just add it in all cases rather than making it optional.
2019-01-10 09:49:28 +02:00
David Steele
ade2c3102d Ignore SIGPIPE signals and check EPIPE result instead.
SIGPIPE immediately terminates the process but we would rather catch the EPIPE error and gracefully shutdown.

Ignore SIGPIPE and throw the EPIPE error via normal error handling.
2019-01-06 17:42:44 +02:00
Douglas J Hunley
7272d6e247 Add _DARWIN_C_SOURCE flag to Makefile for MacOS builds.
For some reason adding -D_POSIX_C_SOURCE=200112L caused MacOS builds to stop working.  Combining both flags seems to work fine for all tested systems.

Contributed by Douglas J Hunley.
2019-01-06 17:28:17 +02:00
David Steele
9560baf659 Move C module include in test.c above headers included for testing.
Including the C module after the headers required for testing meant that if headers were missing from the C module they were not caught while directly testing the C module.

The missing headers were caught in general testing, but it is frustrating to get an error in a module that has already passed while testing another module or running CI.

Move the C module include to the very top so missing headers cause immediate failures.
2019-01-06 15:52:59 +02:00
David Steele
1de22cac2b Rename common/io/handle module to common/io/handleWrite.
ioHandleWriteOneStr() will become a helper function for the IoHandleWrite object.
2019-01-06 14:37:39 +02:00
David Steele
200fd3aa05 Clarify that encryption is always performed client-side.
Suggested by Bruce Burdick.
2019-01-04 12:25:58 +02:00
David Steele
50717aa846 Begin v2.09 development. 2019-01-04 11:00:59 +02:00
David Steele
db24ff8df4 v2.08: Minor Improvements and Bug Fixes
Bug Fixes:

* Remove request for S3 object info directly after putting it. (Reported by Matt Kunkel.)
* Correct archive-get-queue-max to be size type. (Reported by Ronan Dunklau.)
* Add error message when current user uid/gid does not map to a name. (Reported by Camilo Aguilar.)
* Error when --target-action=shutdown specified for PostgreSQL < 9.5.

Improvements:

* Set TCP keepalives on S3 connections. (Suggested by Ronan Dunklau.)
* Reorder info command text output so most recent backup is output last. (Contributed by Cynthia Shang. Suggested by Ryan Lambert.)
* Change file ownership only when required.
* Redact authentication header when throwing S3 errors. (Suggested by Brad Nicholson.)
2019-01-02 22:04:47 +02:00
David Steele
26c888873e Merge common/typeVariantListTest module into common/typeVariantTest.
These modules are closely related so it makes sense for them to be merged.
2019-01-01 18:14:43 +02:00
David Steele
07b9176f25 Merge common/typeStringListTest module into common/typeStringTest.
These modules are closely related so it makes sense for them to be merged.
2019-01-01 18:05:13 +02:00
David Steele
493fb78787 Add strLstInsert() and strLstInsertZ() to StringList object.
Use lstInsert() to implement insertions into any position in a StringList.
2019-01-01 17:31:23 +02:00