Skip to content

Commit

Permalink
droplet: improves handling when truncating volumes
Browse files Browse the repository at this point in the history
Without this change, errors when truncating a droplet volume are silently ignored.
This has resulted in errors afterwards
(After truncating done by automatic recycling, some of the chunks did still exist.
When using the volume afterwards, Bareos complains about not matching volume sizes.)

Now, if truncating fails,
the job fails and the volume state is set to Error.

Accessing the chunks of a volume have been done by dpl_opendir before.
Unfortenatly, this function has a bug and returns only the first 1000 entries.

As we know, that chunks are always named as 4 digit numbers from 0000 to 9999
we now iterate through them.

Be default, iterating the chunks of a volume stops if a chunk does not exist.

However, the truncate function iterate through all possible chunks, from 0000 to 9999
This should cover the case, that an old volume exists with gaps in the chunk list.

This commit also fixes the check_remote function.
Before, if droplet have already be initialized
but connection to backend stops operating,
check_remote still return true. This is now fixed.
  • Loading branch information
joergsteffens committed Nov 10, 2018
1 parent 486ab77 commit b1a7e78
Show file tree
Hide file tree
Showing 2 changed files with 190 additions and 109 deletions.

0 comments on commit b1a7e78

Please sign in to comment.