createBackup returns ok:1 for archived backup when there is no disk space available

Description

Similar to PSMDB-633, but in this case I get correct result when space is not available and backup creates archive of the zero size.

How to Repeat.

1. Create small filesystem:

Go to MongoDB shell, create some data and create archived backup:

So far, so good now:

3. But now we have no space. Let's create one more backup:

You see that new backup is of zero size, but MongoDB shell reports success.

Note that for the "normal" backup command this is not the case and error reported correctly:

Environment

None

AFFECTED CS IDs

276533

Smart Checklist

Activity

Show:

Jira Bot August 10, 2020 at 9:55 AM

To:
CC:

Hi, I'm jira-bot, Percona's Jira automation tool. I've detected that someone from
Percona has made an edit to the Summary field of an issue that you reported.

I'm not sentient (yet) so I'm not sure whether the person fixed a typo, changed
a few words, or completely rewrote the text. In any case, it is Percona Engineering's
intention to make the Summary and Description of an issue as accurate as possible
so that we're fixing the actual problem you're encountering, and to avoid
misunderstandings about symptoms and causes.

If the current Summary does not accurately reflect the problem you are reporting,
or if you feel the change was otherwise inappropriate in some way, please add a
new comment explaining things and we'll address it as soon as we can.

This message will be added only once per issue, regardless of how many times
the Summary is edited.

message-code:summary-edited

Igor Solodovnikov July 17, 2020 at 4:20 PM

Pull request for this issue is here: https://github.com/percona/percona-server-mongodb/pull/575
If there is not enough space on the filesystem following error is returned. In case of error partially created archive file is not deleted.

Akira Kurogane July 17, 2020 at 1:46 PM

I agree it is wrong that it returned "ok": 1 in this instance.

Thanks for working out it is the archive case only. Looking at the code we see that the return code of the archive_write_header() and archive_write_data() function calls are simply ignored.

So those lines at least will be modified, to get the return code and affect the return value.

4.2.8 was released recently, so we won't release the patch until 4.2.9. Thereafter it will be backported into the 4.0 and 3.6 major version branches.

Best regards,

Akira

Done

Details

Assignee

Reporter

Time tracking

5h logged

Priority

Smart Checklist

Created July 17, 2020 at 1:02 PM
Updated March 6, 2024 at 4:48 PM
Resolved August 3, 2020 at 1:53 PM