Skip to content

Commit

Permalink
Merge pull request #1043 from bareos/dev/pstorz/master/fix-isilon-91-…
Browse files Browse the repository at this point in the history
…ndmp

ndmp: introduce workaround for isilon 9.1.0.0 'Invalid nlist.tape_offset -1' error
  • Loading branch information
arogge committed Feb 4, 2022
2 parents 3790ade + 3fb1f1d commit c717320
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 13 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Expand Up @@ -5,6 +5,9 @@ and since Bareos version 20 this project adheres to [Semantic Versioning](https:

## [Unreleased]

### Added
- ndmp: introduce workaround for isilon 9.1.0.0 'Invalid nlist.tape_offset -1' error [PR #1043]
### Breaking Changes

### Fixed
Expand Down Expand Up @@ -41,8 +44,15 @@ and since Bareos version 20 this project adheres to [Semantic Versioning](https:


[PR #1010]: https://github.com/bareos/bareos/pull/1010
[PR #1015]: https://github.com/bareos/bareos/pull/1015
[PR #1016]: https://github.com/bareos/bareos/pull/1016
[PR #1031]: https://github.com/bareos/bareos/pull/1031
[PR #1033]: https://github.com/bareos/bareos/pull/1033
[PR #1035]: https://github.com/bareos/bareos/pull/1035
[PR #1041]: https://github.com/bareos/bareos/pull/1041
[PR #1043]: https://github.com/bareos/bareos/pull/1043
[PR #1046]: https://github.com/bareos/bareos/pull/1046
[PR #1048]: https://github.com/bareos/bareos/pull/1048
[PR #1051]: https://github.com/bareos/bareos/pull/1051
[PR #1054]: https://github.com/bareos/bareos/pull/1054
[unreleased]: https://github.com/bareos/bareos/tree/master
3 changes: 2 additions & 1 deletion core/src/dird/dird_conf.cc
Expand Up @@ -3,7 +3,7 @@
Copyright (C) 2000-2011 Free Software Foundation Europe e.V.
Copyright (C) 2011-2012 Planets Communications B.V.
Copyright (C) 2013-2021 Bareos GmbH & Co. KG
Copyright (C) 2013-2022 Bareos GmbH & Co. KG
This program is Free Software; you can redistribute it and/or
modify it under the terms of version three of the GNU Affero General Public
Expand Down Expand Up @@ -149,6 +149,7 @@ static ResourceItem dir_items[] = {
{ "KeyEncryptionKey", CFG_TYPE_AUTOPASSWORD, ITEM(res_dir, keyencrkey), 1, 0, NULL, NULL, NULL },
{ "NdmpSnooping", CFG_TYPE_BOOL, ITEM(res_dir, ndmp_snooping), 0, 0, NULL, "13.2.0-", NULL },
{ "NdmpLogLevel", CFG_TYPE_PINT32, ITEM(res_dir, ndmp_loglevel), 0, CFG_ITEM_DEFAULT, "4", "13.2.0-", NULL },
{ "NdmpNamelistFhinfoSetZeroForInvalidUquad", CFG_TYPE_BOOL, ITEM(res_dir, ndmp_fhinfo_set_zero_for_invalid_u_quad), 0, CFG_ITEM_DEFAULT, "false", "20.0.6-", NULL },
{ "AbsoluteJobTimeout", CFG_TYPE_PINT32, ITEM(res_dir, jcr_watchdog_time), 0, 0, NULL, "14.2.0-", NULL },
{ "Auditing", CFG_TYPE_BOOL, ITEM(res_dir, auditing), 0, CFG_ITEM_DEFAULT, "false", "14.2.0-", NULL },
{ "AuditEvents", CFG_TYPE_AUDIT, ITEM(res_dir, audit_events), 0, 0, NULL, "14.2.0-", NULL },
Expand Down
7 changes: 5 additions & 2 deletions core/src/dird/dird_conf.h
Expand Up @@ -3,7 +3,7 @@
Copyright (C) 2000-2011 Free Software Foundation Europe e.V.
Copyright (C) 2011-2012 Planets Communications B.V.
Copyright (C) 2013-2021 Bareos GmbH & Co. KG
Copyright (C) 2013-2022 Bareos GmbH & Co. KG
This program is Free Software; you can redistribute it and/or
modify it under the terms of version three of the GNU Affero General Public
Expand Down Expand Up @@ -131,7 +131,10 @@ class DirectorResource
bool optimize_for_speed = false; /* Optimize daemon for speed which may need
more memory */
bool ndmp_snooping = false; /* NDMP Protocol specific snooping enabled */
bool auditing = false; /* Auditing enabled */
bool ndmp_fhinfo_set_zero_for_invalid_u_quad
= false; // Workaround for Isilon 9.1.0.0 not accepting -1 as value for
// FhInfo (which is the tape offset)
bool auditing = false; /* Auditing enabled */
alist<const char*>* audit_events
= nullptr; /* Specific audit events to enable */
uint32_t ndmp_loglevel = 0; /* NDMP Protocol specific loglevel to use */
Expand Down
11 changes: 7 additions & 4 deletions core/src/dird/ndmp_dma_restore_NDMP_BAREOS.cc
Expand Up @@ -2,7 +2,7 @@
BAREOS® - Backup Archiving REcovery Open Sourced
Copyright (C) 2011-2016 Planets Communications B.V.
Copyright (C) 2013-2019 Bareos GmbH & Co. KG
Copyright (C) 2013-2022 Bareos GmbH & Co. KG
This program is Free Software; you can redistribute it and/or
modify it under the terms of version three of the GNU Affero General Public
Expand Down Expand Up @@ -126,11 +126,13 @@ static inline int set_files_to_restore(JobControlRecord* jcr,
if (bstrncmp(restore_pathname.c_str(), ndmp_filesystem, len)) {
AddToNamelist(job, restore_pathname.c_str() + len, restore_prefix,
(char*)"", (char*)"", NDMP_INVALID_U_QUAD,
NDMP_INVALID_U_QUAD);
NDMP_INVALID_U_QUAD,
me->ndmp_fhinfo_set_zero_for_invalid_u_quad);
} else {
AddToNamelist(job, restore_pathname.c_str(), restore_prefix,
(char*)"", (char*)"", NDMP_INVALID_U_QUAD,
NDMP_INVALID_U_QUAD);
NDMP_INVALID_U_QUAD,
me->ndmp_fhinfo_set_zero_for_invalid_u_quad);
}
cnt++;
}
Expand Down Expand Up @@ -288,7 +290,8 @@ static inline bool fill_restore_environment(JobControlRecord* jcr,
== 0) {
// There is no specific filename selected so restore everything.
AddToNamelist(job, (char*)"", destination_path.c_str(), (char*)"",
(char*)"", NDMP_INVALID_U_QUAD, NDMP_INVALID_U_QUAD);
(char*)"", NDMP_INVALID_U_QUAD, NDMP_INVALID_U_QUAD,
me->ndmp_fhinfo_set_zero_for_invalid_u_quad);
}
}

Expand Down
11 changes: 7 additions & 4 deletions core/src/dird/ndmp_dma_restore_common.cc
Expand Up @@ -2,7 +2,7 @@
BAREOS® - Backup Archiving REcovery Open Sourced
Copyright (C) 2011-2015 Planets Communications B.V.
Copyright (C) 2013-2019 Bareos GmbH & Co. KG
Copyright (C) 2013-2022 Bareos GmbH & Co. KG
This program is Free Software; you can redistribute it and/or
modify it under the terms of version three of the GNU Affero General Public
Expand Down Expand Up @@ -87,7 +87,8 @@ void AddToNamelist(struct ndm_job_param* job,
char* name,
char* other_name,
uint64_t node,
uint64_t fhinfo)
uint64_t fhinfo,
bool set_zero_for_invalid_u_quad)
{
ndmp9_name nl;
PoolMem destination_path;
Expand All @@ -108,15 +109,17 @@ void AddToNamelist(struct ndm_job_param* job,
nl.name = name;
nl.other_name = other_name;


// add fh_node and fh_info for DAR for native NDMP backup
nl.node = node;

if (fhinfo) {
nl.fh_info.value = fhinfo;
// check if we need to set 0 instead of NDMP_INVALID_U_QUAD
if (set_zero_for_invalid_u_quad && fhinfo == NDMP_INVALID_U_QUAD) {
nl.fh_info.value = 0;
}
nl.fh_info.valid = NDMP9_VALIDITY_VALID;
}

ndma_store_nlist(&job->nlist_tab, &nl);
}

Expand Down
5 changes: 3 additions & 2 deletions core/src/dird/ndmp_dma_restore_common.h
@@ -1,7 +1,7 @@
/*
BAREOS® - Backup Archiving REcovery Open Sourced
Copyright (C) 2018-2018 Bareos GmbH & Co. KG
Copyright (C) 2018-2022 Bareos GmbH & Co. KG
This program is Free Software; you can redistribute it and/or
modify it under the terms of version three of the GNU Affero General Public
Expand Down Expand Up @@ -34,7 +34,8 @@ void AddToNamelist(struct ndm_job_param* job,
char* name,
char* other_name,
uint64_t node,
uint64_t fhinfo);
uint64_t fhinfo,
bool set_zero_for_invalid_u_quad = false);
int SetFilesToRestoreNdmpNative(JobControlRecord* jcr,
struct ndm_job_param* job,
int32_t FileIndex,
Expand Down
Expand Up @@ -188,6 +188,13 @@
"equals": true,
"versions": "13.2.0-"
},
"NdmpNamelistFhinfoSetZeroForInvalidUquad": {
"datatype": "BOOLEAN",
"code": 0,
"default_value": "false",
"equals": true,
"versions": "20.0.6-"
},
"AbsoluteJobTimeout": {
"datatype": "PINT32",
"code": 0,
Expand Down
@@ -0,0 +1 @@
This directive enables a bug workaround for Isilon 9.1.0.0 systems where the NDMP namelists tape offset (also known as fhinfo) is sanity checked resulting in valid value -1 being no more accepted. The Isilon system sends the following error message: 'Invalid nlist.tape_offset -1 at index 1 - tape offset not aligned at 512B boundary'. The workaround sends 0 instead of -1 which is accepted by the Isilon system and enables normal operation again.
Expand Up @@ -29,6 +29,7 @@ Director {
# OptimizeForSpeed = No
NdmpSnooping = Yes
NdmpLogLevel = 40
# NdmpNamelistFhinfoSetZeroForInvalidUquad = No
AbsoluteJobTimeout = 10
Auditing = Yes
AuditEvents = "item11", "item12", ".*"
Expand Down

0 comments on commit c717320

Please sign in to comment.