View Issue Details

IDProjectCategoryView StatusLast Update
0000988bareos-core[All Projects] Generalpublic2018-07-20 23:18
ReporterIvanBayanAssigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status newResolutionopen 
PlatformLinuxOSUbuntuOS Version16.04
Product Version17.2.4 
Target VersionFixed in Version 
Summary0000988: Truncate command do nothing
DescriptionLooks like bareos simple ignore truncate command. Since truncate option was removed from purge command, it's impossible to truncate volume from cli:
Steps To Reproduce1. Purge volumes
2. Check that them was purged.
# echo "list volumes pool=ow-backup03_veeam_full"|bconsole|tail -n 4
| 390 | ow-backup01-fd-ow-backup03_veeam_full-20170711-2119-423 | Purged | 1 | 10,737,377,563 | 2 | 1,296,000 | 0 | 0 | 0 | File_ow-backup03_dev-03 | 2017-07-11 21:20:58 | ow-backup03_dev-03-sd |
| 391 | ow-backup01-fd-ow-backup03_veeam_full-20170711-2120-423 | Purged | 1 | 4,858,174,249 | 1 | 1,296,000 | 0 | 0 | 0 | File_ow-backup03_dev-03 | 2017-07-11 21:21:47 | ow-backup03_dev-03-sd |
+---------+---------------------------------------------------------+-----------+---------+----------------+----------+--------------+---------+------+-----------+-------------------------+---------------------+-----------------------+
3. Invoke truncate
# echo "truncate volstatus=Purged pool=ow-backup03_veeam_full yes"|bconsole
Connecting to Director localhost:9101
1000 OK: mia-backup03-dir Version: 17.2.4 (21 Sep 2017)
Enter a period to cancel a command.
truncate volstatus=Purged pool=ow-backup03_veeam_full yes
Automatically selected Catalog: MyCatalog
Using Catalog "MyCatalog"
No results to list.
You have messages.
4. Check that volumes stay untouched:
# ls -lh /mnt/storage-dev-03/bareos/storage/ow-backup01-fd-ow-backup03_veeam_full-20170711-21{19,20}*
-rw-r----- 1 bareos bareos 10G Jul 11 2017 /mnt/storage-dev-03/bareos/storage/ow-backup01-fd-ow-backup03_veeam_full-20170711-2119-423
-rw-r----- 1 bareos bareos 4.6G Jul 11 2017 /mnt/storage-dev-03/bareos/storage/ow-backup01-fd-ow-backup03_veeam_full-20170711-2120-423
TagsNo tags attached.
bareos-master: impact
bareos-master: action
bareos-18.2: impact
bareos-18.2: action
bareos-17.2: impact
bareos-17.2: action
bareos-16.2: impact
bareos-16.2: action
bareos-15.2: impact
bareos-15.2: action
bareos-14.2: impact
bareos-14.2: action
bareos-13.2: impact
bareos-13.2: action
bareos-12.4: impact
bareos-12.4: action

Activities

aron_s

aron_s

2018-07-20 13:20

developer   ~0003078

Last edited: 2018-07-20 13:20

View 2 revisions

Could you try to specify each of the volumes when truncating them ?
The usage of the truncate command is truncate volstatus=Purged [storage=<storage>] [pool=<pool>] [volume=<volume>] [yes], so try

truncate volstatus=Purged pool=ow-backup03_veeam_full volume=ow-backup01-fd-ow-backup03_veeam_full-20170711-2119-423 yes

truncate volstatus=Purged pool=ow-backup03_veeam_full volume= ow-backup01-fd-ow-backup03_veeam_full-20170711-2120-423 yes

IvanBayan

IvanBayan

2018-07-20 13:42

reporter   ~0003079

I've already deleted that volumes, but done test for you with different volume and got same result:
# ls -lh mia-backup03-fd-mia-backup03_mixed_differential-20170930-568-00
-rw-r----- 1 bareos bareos 3.7G Sep 30 2017 mia-backup03-fd-mia-backup03_mixed_differential-20170930-568-00


*purge volume=mia-backup03-fd-mia-backup03_mixed_differential-20170930-568-00

This command can be DANGEROUS!!!
.....
This command requires full access to all resources.
1 File on Volume "mia-backup03-fd-mia-backup03_mixed_differential-20170930-568-00" purged from catalog.
There are no more Jobs associated with Volume "mia-backup03-fd-mia-backup03_mixed_differential-20170930-568-00". Marking it purged.

*list volume=mia-backup03-fd-mia-backup03_mixed_differential-20170930-568-00
+---------+-----------------------------------------------------------------+-----------+---------+---------------+----------+--------------+---------+------+-----------+-----------------------------+---------------------+---------------------------+
| mediaid | volumename | volstatus | enabled | volbytes | volfiles | volretention | recycle | slot | inchanger | mediatype | lastwritten | storage |
+---------+-----------------------------------------------------------------+-----------+---------+---------------+----------+--------------+---------+------+-----------+-----------------------------+---------------------+---------------------------+
| 413 | mia-backup03-fd-mia-backup03_mixed_differential-20170930-568-00 | Purged | 1 | 3,903,535,449 | 0 | 5,184,000 | 0 | 0 | 0 | File_mia-backup03_storage03 | 2017-09-30 21:00:36 | mia-backup03_storage03-sd |
+---------+-----------------------------------------------------------------+-----------+---------+---------------+----------+--------------+---------+------+-----------+-----------------------------+---------------------+---------------------------+
# ls -lh mia-backup03-fd-mia-backup03_mixed_differential-20170930-568-00
-rw-r----- 1 bareos bareos 3.7G Sep 30 2017 mia-backup03-fd-mia-backup03_mixed_differential-20170930-568-00

So, volume specification in truncate command make no difference.
aron_s

aron_s

2018-07-20 13:43

developer   ~0003080

As a proof of functionality I tried this myself with a filestorage and it worked flawless.

$ echo "list volumes pool=truncate-test"|bconsole|tail -n 4
| mediaid | volumename | volstatus | enabled | volbytes | volfiles | volretention | recycle | slot | inchanger | mediatype | lastwritten | storage |
+---------+--------------+-----------+---------+------------+----------+--------------+---------+------+-----------+-----------+---------------------+--------------------------+
| 3 | Truncate-001 | Purged | 1 | 22,947,582 | 0 | 31,536,000 | 1 | 0 | 0 | File | 2018-07-20 13:28:00 | ubuntu1604-VirtualBox-sd |
+---------+--------------+-----------+---------+------------+----------+--------------+---------+------+-----------+-----------+---------------------+--------------------------+
$ ls -lh /var/lib/bareos/storage/Truncate-001
-rw-r----- 1 bareos bareos 22M Jul 20 13:28 /var/lib/bareos/storage/Truncate-001
$ echo "truncate volstatus=Purged pool=truncate-test yes"|bconsole
[...]
Sending relabel command from "Truncate-001" to "Truncate-001" ...
3000 OK label. VolBytes=231 Volume="Truncate-001" Device="FileStorage" (/var/lib/bareos/storage)
The volume 'Truncate-001' has been truncated.
$ ls -lh /var/lib/bareos/storage/Truncate-001
-rw-r----- 1 bareos bareos 231 Jul 20 13:38 /var/lib/bareos/storage/Truncate-001
IvanBayan

IvanBayan

2018-07-20 15:08

reporter   ~0003081

So, is here a way to help you with debugging?
*version
mia-backup03-dir Version: 17.2.4 (21 Sep 2017) x86_64-pc-linux-gnu ubuntu Ubuntu 16.04 LTS xUbuntu_16.04 x86_64
*status storage=mia-backup03_storage03-sd
Connecting to Storage daemon mia-backup03_storage03-sd at mia-backup03.int:9103

mia-backup03_storage03-sd Version: 17.2.4 (21 Sep 2017) x86_64-pc-linux-gnu ubuntu Ubuntu 16.04 LTS
aron_s

aron_s

2018-07-20 23:18

developer   ~0003082

I will look into the changes between Bareos 18.2 and 17.2 when it comes to truncating. If there are none, it must be something outside of Bareos.

Issue History

Date Modified Username Field Change
2018-07-19 11:57 IvanBayan New Issue
2018-07-20 13:20 aron_s Note Added: 0003078
2018-07-20 13:20 aron_s Note Edited: 0003078 View Revisions
2018-07-20 13:42 IvanBayan Note Added: 0003079
2018-07-20 13:43 aron_s Note Added: 0003080
2018-07-20 15:08 IvanBayan Note Added: 0003081
2018-07-20 23:18 aron_s Note Added: 0003082