Changesets: bareos

master a79789a4

2024-01-23 10:32

Sebastian Sura


Committer: Bareos Bot

Ported: N/A

Details Diff
connection-pool: fix data race

Some operations were improperly synchronized. For example take
cleanup() for example:

```
|for (i = connections_->size() - 1; i >= 0; i--) {
1| connection = connections_->get(i);
| Dmsg2(800, "checking connection %s (%d)\n", connection->name(), i);
2| if (!connection->check()) {
| Dmsg2(120, "connection %s (%d) is terminated => removed\n",
| connection->name(), i);
| connections_->remove(i);
4| delete (connection);
| }
|}
```
We dont lock connections_ or connection in anyway here. This means
that not only could we get a NULL returned at (1), we also have to
account for the fact that at any moment connection could get deleted
from under us from a different thread -- even if we are currently
holding its lock. This will happen if two threads call cleanup at
the same time and one is at (2) while the other one is at (4).

Similarly the check() function just calls WaitDataIntr() on the socket
without ensuring exclusive access (for example by locking the
connection!). WaitDataIntr is not a const function so its not safe to
call without ensuring exclusive access. Even though it might look
like this should be safe since the function just waits, but it in fact
can write to some internal data (e.g. b_errno in case of an error)
which can definitely cause problems.

Connection::in_use is also very misleading. While it does not suffer
from the data race problem (as its an atomic value), its
interpretation does: If you read false from it, you do not actually know
whether some thread is using the connection (and has yet to update the
bool) or if the connection is actually unused.

All these problems and some more lead to the decision to rewrite this
code completely.

The basic idea is that the connection pool now is simply a vector of
connections protected by one lock. The connections itself do not have
a lock.

The locks are owned by the vector. The only way to interact with the
connections inside the pool is by locking the whole vector. This
eliminates all the problems above.

The connections itself are now also an raii type. They own the socket
they hold. That means that they will take care of closing/destroying
the socket once they leave the scope (similarly to a unique pointer).
mod - core/src/dird/fd_cmds.cc Diff File
mod - core/src/dird/fd_cmds.h Diff File
mod - core/src/dird/job.cc Diff File
mod - core/src/dird/socket_server.cc Diff File
mod - core/src/dird/ua_status.cc Diff File
mod - core/src/lib/connection_pool.cc Diff File
mod - core/src/lib/connection_pool.h Diff File

master fba26955

2024-01-23 09:32

Bareos Bot


Committer: GitHub

Ported: N/A

Details Diff
Merge pull request #1671

Disable automated package-tests for SLES 12
mod - .matrix.yml Diff File
mod - CHANGELOG.md Diff File

master aac715b5

2024-01-23 09:32

Bareos Bot

Ported: N/A

Details Diff
Update CHANGELOG.md
mod - CHANGELOG.md Diff File

master cdbf6e2a

2024-01-22 18:24

Bareos Bot


Committer: GitHub

Ported: N/A

Details Diff
Merge pull request #1672

bareos-config: fix output of deploy_config
mod - CHANGELOG.md Diff File
mod - core/scripts/bareos-config-lib.sh.in Diff File

master 6b6592b1

2024-01-22 18:24

Bareos Bot

Ported: N/A

Details Diff
Update CHANGELOG.md
mod - CHANGELOG.md Diff File

master f71af481

2024-01-22 14:33

joergs

Ported: N/A

Details Diff
bareos-config: fix output of deploy_config

Replacing the initial variables have been to noisy,
especially newly generated passwords have also be printed.
mod - core/scripts/bareos-config-lib.sh.in Diff File

master 98647a4d

2024-01-22 13:12

arogge

Ported: N/A

Details Diff
devtools: update python dependencies (again)
mod - devtools/pip-tools/Pipfile.lock Diff File

master 2a5b032e

2024-01-22 13:06

arogge


Committer: Bareos Bot

Ported: N/A

Details Diff
matrix: disable automated tests for SLES 12

As SLES 12 is the only remaining system that cannot run the
package-tests in a podman container due to its very old systemd version,
we disable the testing here so we can finally move to plain podman for
the tests.
mod - .matrix.yml Diff File

master 0d9623ad

2024-01-22 12:17

joergs


Committer: Bareos Bot

Ported: N/A

Details Diff
bareos_tasks.pgsql: fix example
mod - contrib/fd-plugins/bareos_tasks/pgsql/README.md Diff File

master 8e12c147

2024-01-22 07:24

Bareos Bot


Committer: GitHub

Ported: N/A

Details Diff
Merge pull request #1665

filed: fix vss during client initiated connections
mod - CHANGELOG.md Diff File
mod - core/src/dird/backup.cc Diff File
mod - core/src/filed/dir_cmd.cc Diff File
mod - core/src/lib/berrno.cc Diff File
mod - core/src/tests/berrno_test.cc Diff File
mod - core/src/win32/filed/vss_generic.cc Diff File

master 98a50b04

2024-01-22 07:23

Bareos Bot

Ported: N/A

Details Diff
Update CHANGELOG.md
mod - CHANGELOG.md Diff File

master ab50c76b

2024-01-19 10:26

Sebastian Sura


Committer: Bareos Bot

Ported: N/A

Details Diff
dedup-volume: fix reserving instead of allocating
mod - core/src/stored/backends/dedup/volume.cc Diff File

master f32749d6

2024-01-19 10:26

Sebastian Sura

Ported: N/A

Details Diff
fvec: add alloc_uninit function
mod - core/src/stored/backends/dedup/fvec.h Diff File

master 0fe8762f

2024-01-19 10:24

Sebastian Sura


Committer: Bareos Bot

Ported: N/A

Details Diff
dedup-volume: fix CommitBlock/AbortBlock error

It was previously not possible to abort once a commit was
started (since the savestate was moved immediately on the CommitBlock
call). This was fixed by instead waiting for the commit to finish
before issueing the move.
mod - core/src/stored/backends/dedup/volume.cc Diff File
mod - core/src/stored/backends/dedup/volume.h Diff File
mod - core/src/stored/backends/dedup_device.cc Diff File

master 041cc167

2024-01-19 08:31

Sebastian Sura


Committer: Bareos Bot

Ported: N/A

Details Diff
berrno: better error messages

Now the error number is always printed and trailing whitespace is
trimmed.
mod - core/src/lib/berrno.cc Diff File
mod - core/src/tests/berrno_test.cc Diff File

master 78b41049

2024-01-19 08:09

Sebastian Sura


Committer: Bareos Bot

Ported: N/A

Details Diff
backup: fix printing bad jobid

jobids are 32bit, but are printed as 64bit -> bad things happens on
windows.
mod - core/src/dird/backup.cc Diff File

master caa43e3d

2024-01-19 08:05

Sebastian Sura


Committer: Bareos Bot

Ported: N/A

Details Diff
filed: fix not setting up thread specific jcr

When using client initiated connection we do not call the normal
procedure but instead directly call process_director_commands. This
caused us to not correctly initialise the threadspecific jcr, which is
used in 1) debug messages and 2) for vss name lookup

This caused us to print bad jobids in debug messages as well as not
using the vss system at all.
mod - core/src/filed/dir_cmd.cc Diff File

master eb8cafad

2024-01-19 07:23

Sebastian Sura


Committer: Bareos Bot

Ported: N/A

Details Diff
vss-generic: find additional files to exclude/include
mod - core/src/win32/filed/vss_generic.cc Diff File

master e23b9220

2024-01-17 16:44

arogge


Committer: Bareos Bot

Ported: N/A

Details Diff
remove explicit dependency on pgsql

USES+=pgsql will pin us to a specific version of PostgreSQL, which is
probably not a great idea, so we remove it.
This will retain the (automatic) requirement to libpq, so a compatible
postgresql client will be required by the binary package.
mod - core/platforms/freebsd/bareos-freebsd/bareos.com-database-postgresql/Makefile Diff File

master 4816ac15

2024-01-17 13:11

Sebastian Sura


Committer: Bareos Bot

Ported: N/A

Details Diff
bareos-systemtest-functions: fix bad regex replace

Depending on where your source code is located, the regex replace may
remove more than just the path prefix that we want to
replace (e.g. source is located at /bareos -> bad replace for
etc/bareos/...).

Now ALL_FILES contains paths relative to CMAKE_SOURCE_DIR (that way we
do not need to remove it anymore). To restore the previous behaviour
we now just need to prepend the source directory again to get the
CURRENT_FILE.
mod - systemtests/cmake/BareosSystemtestFunctions.cmake Diff File

master bf5f42c8

2024-01-17 12:00

joergs


Committer: Bareos Bot

Ported: N/A

Details Diff
cmake: marking some options as advanced

Some option are ON by default.
This change marks them as advanced
and removes them from the build descriptions.
mod - cmake/BareosSetVariableDefaults.cmake Diff File
mod - core/CMakeLists.txt Diff File
mod - core/platforms/freebsd/bareos-freebsd/bareos.com-common/BareosCommonMakefile Diff File
mod - core/platforms/packaging/bareos.spec Diff File
mod - debian/rules Diff File

master 27cda324

2024-01-17 11:50

Sebastian Sura


Committer: Bareos Bot

Ported: N/A

Details Diff
packaging: add dedup backend to packaging
mod - core/platforms/packaging/bareos.spec Diff File
mod - core/src/stored/CMakeLists.txt Diff File
add - core/src/stored/backends/dedup_device.d/bareos-dir.d/storage/dedup.conf.example Diff File
add - core/src/stored/backends/dedup_device.d/bareos-sd.d/device/dedup.conf.example Diff File
add - debian/bareos-storage-dedup.install.in Diff File
mod - debian/control Diff File
mod - debian/control.bareos-storage Diff File
mod - docs/pkglists/Debian_11.x86_64 Diff File
mod - docs/pkglists/Debian_12.x86_64 Diff File
mod - docs/pkglists/EL_8.x86_64 Diff File
mod - docs/pkglists/EL_9.aarch64 Diff File
mod - docs/pkglists/EL_9.x86_64 Diff File
mod - docs/pkglists/Fedora_38.x86_64 Diff File
mod - docs/pkglists/Fedora_39.x86_64 Diff File
mod - docs/pkglists/Fedora_40.x86_64 Diff File
mod - docs/pkglists/FreeBSD_12.1.amd64 Diff File
mod - docs/pkglists/SUSE_15.x86_64 Diff File
mod - docs/pkglists/xUbuntu_20.04.x86_64 Diff File
mod - docs/pkglists/xUbuntu_22.04.x86_64 Diff File
mod - docs/pkglists/xUbuntu_24.04.x86_64 Diff File

master ea3256a3

2024-01-17 09:27

Sebastian Sura

Ported: N/A

Details Diff
fvec: fix posix_fallocate for unsupported filesystems

we use ftruncate if posix_fallocate does not work
mod - core/src/stored/backends/dedup/fvec.h Diff File

master 4806ac83

2024-01-17 09:25

Sebastian Sura

Ported: N/A

Details Diff
fvec: add more information to error messages
mod - core/src/stored/backends/dedup/fvec.h Diff File

master bda0943c

2024-01-17 08:05

Sebastian Sura

Ported: N/A

Details Diff
fvec-test: fix test for parallel execution

The test did not support each subtest getting called on its own (since
they shared state). To fix this each test now gets its own file, as
well as each test setting up the file how they need it to be.
mod - core/src/tests/fvec.cc Diff File
 First  Prev  1 2 3 ... 70 ... 77 78 79 80 81 82 83 ... 140 ... 210 ... 280 ... 350 ... 420 ... 490 ... 560 ... 630 ... 678 679 680  Next  Last