bareos: bareos-15.2 9b78b96b

Author Committer Branch Timestamp Parent
mvwieringen mvwieringen bareos-15.2 2015-10-30 22:41 bareos-15.2 3ed7a1da Pending
Affected Issues  0000330: NDMP protocol error
Changeset NDMP: Add out of order meta data handling.

This uses an additional hash table when we receive the FHDB dir
information in a somewhat random order from the NDMP DATA Agent.
The NetApp NDMP implementation is known to do this semi random ordering.

We pre-allocate the nodes in the same way they are normally created them
but store them temporary in the hash table as a pointer to the node and
the node id of its parent. This way we use the tree alloc optimal.

When we start processing the actual node information we first look if
there is any out of order metadata captured in the hash table. If so we
do a linear walk of the hash table and recursivly create the missing
parent nodes until we can connect things to the existing tree. For
creating the parent node we hash lookup the parent node in the hash and
try inserting it into the tree. When we consume the node for a parent
node we set the pointer to the node to NULL in the hash table entry.
This way the linear walk knows we already visited this node and can skip
it.
mod - src/dird/ndmp_fhdb_mem.c Diff File