Issue Details (XML | Word | Printable)

Key: CORE-2984
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Alexander Peshkov
Reporter: Damyan Ivanov
Votes: 0
Watchers: 1

If you were logged in you would be able to see more operations.
Firebird Core

gbak -v srv:db stdout creates a broken backup

Created: 01/May/10 05:28 AM   Updated: 18/Jan/16 05:18 PM
Component/s: GBAK
Affects Version/s: 2.5 RC2
Fix Version/s: 2.5 RC3, 3.0 Alpha 1

Environment: any
Issue Links:

QA Status: No test

 Description  « Hide
Before 2.5, it was possible to use the following command to create a compressed backup and watch the progress:

  gbak -v srv:db stdout | gzip > db.fbk.gz

With 2.5, this creates a broken backup, because the output of the '-v' switch is sent to standard output, mixing it with the backup stream. Before 2.5 the '-v' output was sent to standard error.

More discussion in the following thread at firebird-devel

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Alexander Peshkov added a comment - 06/May/10 01:53 PM
When working with this issue, I've found that stdout and stderr are incorrectly mixed in services, making some services return errors in status vector (correct behavior), others (like mentioned gbak) - as text in same way as verbose information is returned. To fix that crap, all data sent by services/utilities (this is same thing for us) was divided into 3 classes: errors, verbose info and binary data.

When working as standalone utility errors are printed to stderr, verbose messages go to stdout. But when utility is outputting binary data to stdout (looks like only gbak can do it now?), verbose info also goes now to stderr.

When working as service, utility does not print error messages - it sends status vector to services manager, verbose info is delivered to the user. When utility decides to send binary data to the user (only gsec does it now), delivery of verbose info should not be done. Cause gsec has no verbose info at all, no problems with it now. But when doing server-site backup (issue 2666), one more careful review of gbak may be needed.

Alexander Peshkov added a comment - 06/May/10 01:56 PM
When doing server-site backup, it's critical not to mix gbak data with some messages, possibly generated by gbak.