]> git.proxmox.com Git - proxmox-backup.git/log
proxmox-backup.git
29 hours agodocs: fix warnings in external-metric-server page master
Gabriel Goller [Thu, 10 Oct 2024 13:26:42 +0000 (15:26 +0200)]
docs: fix warnings in external-metric-server page

Rename external-metric-server page and fix code-block to remove some
warnings.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
29 hours agodocs: add node.cfg man page
Gabriel Goller [Thu, 10 Oct 2024 13:26:41 +0000 (15:26 +0200)]
docs: add node.cfg man page

Add man page for the node.cfg config file.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
 [ TL: pull out sorting of synopsis file list to separate commit ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
29 hours agobuildsys: sort list of generated synopsis and man page files alphabetically
Thomas Lamprecht [Fri, 18 Oct 2024 15:54:23 +0000 (17:54 +0200)]
buildsys: sort list of generated synopsis and man page files alphabetically

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 days agoclient: progress log: small opinionated code clean-up
Thomas Lamprecht [Thu, 17 Oct 2024 14:51:39 +0000 (16:51 +0200)]
client: progress log: small opinionated code clean-up

It was fine as is, but IMO saving a few lines is nice, albeit it makes
the atomic fetch expressions look slightly complexer by wrapping them
directly with the HumanByte and TimeSpan from-constructors.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 days agopartial fix #5560: client: periodically show backup progress
Christian Ebner [Fri, 11 Oct 2024 09:33:55 +0000 (11:33 +0200)]
partial fix #5560: client: periodically show backup progress

Spawn a new tokio task which about every minute displays the
cumulative progress of the backup for pxar, ppxar or img archive
streams. Catalog and metadata archive streams are excluded from the
output for better readability, and because the catalog upload lives
for the whole upload time, leading to possible temporal
misalignments in the output. The actual payload data is written via
the other streams anyway.

Add accounting for uploaded chunks, to distinguish from chunks queued
for upload, but not actually uploaded yet.

Example output in the backup task log:
```
...
INFO:  processed 2.471 GiB in 1m, uploaded 2.439 GiB
INFO:  processed 4.963 GiB in 2m, uploaded 4.929 GiB
INFO:  processed 7.349 GiB in 3m, uploaded 7.284 GiB
...
```

This partially fixes issue 5560:
https://bugzilla.proxmox.com/show_bug.cgi?id=5560

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 days agodocs: installation: fix wrong product reference
Christoph Heiss [Thu, 26 Sep 2024 13:32:48 +0000 (15:32 +0200)]
docs: installation: fix wrong product reference

This was probably copied verbatim from pve-docs and forgotten to be
appropriately changed.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2 days agodocs: Fix typo for chunk directory naming and rewording
Christian Ebner [Fri, 11 Oct 2024 07:18:58 +0000 (09:18 +0200)]
docs: Fix typo for chunk directory naming and rewording

The chunks subdirectories are only using the chunk's 2 byte checksum
prefix given in hex notation.

Also, clarify that chunks are grouped into subdirectories.

Reported in the community forum:
https://forum.proxmox.com/threads/155751/

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
3 days agodebian: run wrap-and-sort -tkn to normalize control files
Thomas Lamprecht [Wed, 16 Oct 2024 12:34:11 +0000 (14:34 +0200)]
debian: run wrap-and-sort -tkn to normalize control files

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 days agoapi: metrics: check permissions before reading any data from the cache
Lukas Wagner [Tue, 15 Oct 2024 13:50:28 +0000 (15:50 +0200)]
api: metrics: check permissions before reading any data from the cache

Reading from the metric cache is somewhat expensive, so validate as many
of the required permissions as possible. For host metrics, we can
do the full check in advance. For datastores, we check if we have
audit permissions for *any* datastore. If we do not have privs for
either of those, we return early and avoid reading from the
cache altogether.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Suggested-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 days agoupdate d/control
Wolfgang Bumiller [Tue, 15 Oct 2024 13:32:58 +0000 (15:32 +0200)]
update d/control

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 days agoapi: optimize metrics permission checks a bit
Wolfgang Bumiller [Tue, 15 Oct 2024 12:53:15 +0000 (14:53 +0200)]
api: optimize metrics permission checks a bit

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 days agoapi: add /status/metrics API
Lukas Wagner [Tue, 15 Oct 2024 08:46:36 +0000 (10:46 +0200)]
api: add /status/metrics API

This one is modelled exactly as the one in PVE (there it
is available under /cluster/metrics/export).

The returned data format is quite simple, being an array of
metric records, including a value, a metric name, an id to identify
the object (e.g. datastore/foo, host), a timestamp and a type
('gauge', 'derive', ...). The latter property makes the format
self-describing and aids the metric collector in choosing a
representation for storing the metric data.

[
    ...
    {
"metric": "cpu_avg1",
"value": 0.12,
"timestamp": 170053205,
"id": "host",
"type": "gauge"
    },
    ...
]

In terms of permissions, the new endpoint requires Sys.Audit
on /system/status for metrics of the 'host' object,
and Datastore.Audit on /datastore/{store} for 'datastore/{store}'
metric objects.

Via the 'history' and 'start-time' parameters one can query
the last 30mins of metric history. If these parameters
are not provided, only the most recent metric generation
is returned.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
4 days agometric collection: put metrics in a cache
Lukas Wagner [Tue, 15 Oct 2024 08:46:35 +0000 (10:46 +0200)]
metric collection: put metrics in a cache

Any pull-metric API endpoint can alter access the cache to
retrieve metric data for a limited time (30mins).

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
4 days agometric collection: initialize metric cache on startup
Lukas Wagner [Tue, 15 Oct 2024 08:46:34 +0000 (10:46 +0200)]
metric collection: initialize metric cache on startup

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
4 days agopbs-api-types: add types for the new metrics endpoint
Lukas Wagner [Tue, 15 Oct 2024 08:46:33 +0000 (10:46 +0200)]
pbs-api-types: add types for the new metrics endpoint

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
4 days agometric collection: move impl block for DiskStats to metric_server module
Lukas Wagner [Tue, 15 Oct 2024 08:46:32 +0000 (10:46 +0200)]
metric collection: move impl block for DiskStats to metric_server module

It is only needed there and could be considered an implementation detail
of how this module works.

No functional changes intended.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
4 days agometric collection: drop std::path prefix where not needed
Lukas Wagner [Tue, 15 Oct 2024 08:46:31 +0000 (10:46 +0200)]
metric collection: drop std::path prefix where not needed

No functional changes intended.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
4 days agometric collection: rrd: remove rrd prefix from some function names
Lukas Wagner [Tue, 15 Oct 2024 08:46:30 +0000 (10:46 +0200)]
metric collection: rrd: remove rrd prefix from some function names

We have proper namespaces, so these are a bit redundant.

No functional changes intended.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
4 days agometric collection: rrd: restrict function visibility
Lukas Wagner [Tue, 15 Oct 2024 08:46:29 +0000 (10:46 +0200)]
metric collection: rrd: restrict function visibility

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
4 days agometric collection: rrd: move rrd update function to rrd module
Lukas Wagner [Tue, 15 Oct 2024 08:46:28 +0000 (10:46 +0200)]
metric collection: rrd: move rrd update function to rrd module

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
4 days agometric_collection: split out push metric part
Lukas Wagner [Tue, 15 Oct 2024 08:46:27 +0000 (10:46 +0200)]
metric_collection: split out push metric part

No functional changes intended.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
4 days agometric collection: move rrd_cache to new metric_collection module
Lukas Wagner [Tue, 15 Oct 2024 08:46:26 +0000 (10:46 +0200)]
metric collection: move rrd_cache to new metric_collection module

No functional changes intended.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
4 days agometric collection: add doc comments for public functions
Lukas Wagner [Tue, 15 Oct 2024 08:46:25 +0000 (10:46 +0200)]
metric collection: add doc comments for public functions

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
4 days agoproxy: server: move rrd stat/metric server to separate module
Lukas Wagner [Tue, 15 Oct 2024 08:46:24 +0000 (10:46 +0200)]
proxy: server: move rrd stat/metric server to separate module

With the upcoming pull-metric system/metric caching, these
things should go into a sepearate module.

No functional changes intended.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
5 days agoserver: sync: factor out namespace depth check into sync module
Christian Ebner [Thu, 12 Sep 2024 14:33:00 +0000 (16:33 +0200)]
server: sync: factor out namespace depth check into sync module

By moving and refactoring the check for a sync job exceeding the
global maximum namespace limit, the same function can be reused for
sync jobs in push direction.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
5 days agoserver: sync: make skip reason message more genenric
Christian Ebner [Thu, 12 Sep 2024 14:32:59 +0000 (16:32 +0200)]
server: sync: make skip reason message more genenric

By specifying that the snapshot is being skipped because of the
condition met on the sync target instead of 'local', the same message
can be reused for the sync job in push direction without loosing
sense.

5 days agoserver: sync: move skip info/reason to common sync module
Christian Ebner [Thu, 12 Sep 2024 14:32:58 +0000 (16:32 +0200)]
server: sync: move skip info/reason to common sync module

Make `SkipReason` and `SkipInfo` accessible for sync operations of
both direction variants, push and pull.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
9 days agoserver: sync: move source to common sync module
Christian Ebner [Thu, 12 Sep 2024 14:32:53 +0000 (16:32 +0200)]
server: sync: move source to common sync module

Rename the `PullSource` trait to `SyncSource` and move the trait and
types implementing it to the common sync module, making them
reusable for both sync directions, push and pull.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
9 days agoserver: sync: move reader trait to common sync module
Christian Ebner [Thu, 12 Sep 2024 14:32:52 +0000 (16:32 +0200)]
server: sync: move reader trait to common sync module

Move the `PullReader` trait and the types implementing it to the
common sync module, so this can be reused for the push direction
variant for a sync job as well.

Adapt the naming to be more ambiguous by renaming `PullReader` trait to
`SyncSourceReader`, `LocalReader` to `LocalSourceReader` and
`RemoteReader` to `RemoteSourceReader`.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
9 days agoserver: sync: move sync related stats to common module
Christian Ebner [Thu, 12 Sep 2024 14:32:51 +0000 (16:32 +0200)]
server: sync: move sync related stats to common module

Move and rename the `PullStats` to `SyncStats` as well as moving the
`RemovedVanishedStats` to make them reusable for sync operations in
push direction as well as pull direction.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
9 days agoapi: datastore: add missing whitespace in description
Christian Ebner [Thu, 12 Sep 2024 14:32:50 +0000 (16:32 +0200)]
api: datastore: add missing whitespace in description

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2 weeks agoupdate proxmox-acme to 0.5.3
Wolfgang Bumiller [Thu, 3 Oct 2024 07:54:33 +0000 (09:54 +0200)]
update proxmox-acme to 0.5.3

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 weeks agoupdate to rrd-api-types 1.0.2
Wolfgang Bumiller [Thu, 19 Sep 2024 13:21:45 +0000 (15:21 +0200)]
update to rrd-api-types 1.0.2

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 weeks agoupdate to proxmox-rrd 0.4
Wolfgang Bumiller [Wed, 18 Sep 2024 14:04:20 +0000 (16:04 +0200)]
update to proxmox-rrd 0.4

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 weeks agopxar: bin: rework and dynamically generate `list` test data
Christian Ebner [Wed, 11 Sep 2024 10:47:22 +0000 (12:47 +0200)]
pxar: bin: rework and dynamically generate `list` test data

Commit f16c5de757 ("pxar: bin: test `pxar list` with payload-input")
introduced a regression test for listing of split pxar archives. This
test relies on a large pxar blob file, the large size (> 100M) being
overlooked when writing the test.

In order to not depend on this file any further in the future, drop
it and rewrite the test to dynamically generate the files, needed and
further extend the test thereby also cover the archive creation and
extraction for split pxar archives.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
6 weeks agoapi: replace deprecated 'streaming' attribute with 'serializing'
Wolfgang Bumiller [Thu, 5 Sep 2024 11:37:40 +0000 (13:37 +0200)]
api: replace deprecated 'streaming' attribute with 'serializing'

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 weeks agoupdate to proxmox-router 3 and proxmox-rest-server 0.8
Wolfgang Bumiller [Thu, 5 Sep 2024 11:35:21 +0000 (13:35 +0200)]
update to proxmox-router 3 and proxmox-rest-server 0.8

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 weeks agopxar: list stuff to stdout instead of stderr
Wolfgang Bumiller [Thu, 5 Sep 2024 11:58:26 +0000 (13:58 +0200)]
pxar: list stuff to stdout instead of stderr

Our tooling really needs to stop doing outputs wrong...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 weeks agobump proxmox-log dependency to 0.2.4 for stderr logging
Wolfgang Bumiller [Thu, 5 Sep 2024 11:47:58 +0000 (13:47 +0200)]
bump proxmox-log dependency to 0.2.4 for stderr logging

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 weeks agopxar-bin: remove `log` dependency, use `tracing` directly
Gabriel Goller [Wed, 4 Sep 2024 13:28:57 +0000 (15:28 +0200)]
pxar-bin: remove `log` dependency, use `tracing` directly

When using the `log` to `tracing` translation layer, the messages get
padded with whitespaces. This bug will get fixed upstream [0], but in
the meantime we switch to the `tracing` macros.

[0]: https://github.com/tokio-rs/tracing/pull/3070

Tested-by: Christian Ebner <c.ebner@proxmox.com>
Reviewed-by: Christian Ebner <c.ebner@proxmox.com>
Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
6 weeks agotape: fix read element status for some changers
Dominik Csapak [Mon, 26 Aug 2024 14:04:59 +0000 (16:04 +0200)]
tape: fix read element status for some changers

It seems some changers are setting the PVolTag/AVolTag flags in the
ELEMENT STATUS page response, but don't include the actual fields then.
To make it work with such changers, downgrade the errors to warnings, so
we can continue to decode the remaining data.

This is OK since one volume tag is optional and the other is skipped
anyway.

Reported in the forum:
https://forum.proxmox.com/threads/hpe-storeonce-vtl.152547/

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
7 weeks agomove client binaries to tracing
Gabriel Goller [Thu, 29 Aug 2024 13:40:40 +0000 (15:40 +0200)]
move client binaries to tracing

Add tracing logger to all client binaries and remove env_logger.

The reason for this change is twofold: our migration to tracing, and the
behavior when the client calls an api handler directly. Currently the
proxmox-backup-manager calls the api handlers directly for some
commands. This results in no output (on console and task log), as no
tracing logger is instantiated.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
7 weeks agofix #5622: backup client: properly handle rate/burst parameters
Dominik Csapak [Fri, 9 Aug 2024 08:20:32 +0000 (10:20 +0200)]
fix #5622: backup client: properly handle rate/burst parameters

The rate and burst parameters are integers, so the mapping from value
with `.as_str()` will always return `None` effectively never
applying any rate limit at all.

Fix it by turning them into a HumanByte instead of an integer.

To not crowd the parameter section so much, create a
ClientRateLimitConfig struct that gets flattened into the parameter list
of the backup client.

To adapt the description of the parameters, add new schemas that copy
the `HumanByte` schema but change the description.

With this, the rate limit actually works, and there is no lower limit
any more.

The old TRAFFIC_CONTROL_RATE/BURST_SCHEMAs can be deleted since the
client was the only user of them.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
7 weeks agodata_blob: add TODO comment for zstd api
Dominik Csapak [Thu, 8 Aug 2024 08:18:25 +0000 (10:18 +0200)]
data_blob: add TODO comment for zstd api

we currently use the behavior of zstd that is not part of the public
api, so this is at risk to be changed without notice.

There is a public api that we could use, but it's only available
with zstd_sys >= 2.0.9, which at this time, is not yet packaged for/by
us.

Add a comment that we can use the public api for this when the
new version of the crate gets available.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
7 weeks agofix: proxmox-backup-manager network reload wait on worker
Gabriel Goller [Wed, 21 Aug 2024 10:22:36 +0000 (12:22 +0200)]
fix: proxmox-backup-manager network reload wait on worker

Make the `network reload` command in proxmox-backup-manager wait on the
api handler's workertask. Otherwise the task would be killed when the
client exits.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
7 weeks agoui: user view: disable 'Unlock TFA' button by default
Christoph Heiss [Thu, 22 Aug 2024 11:08:36 +0000 (13:08 +0200)]
ui: user view: disable 'Unlock TFA' button by default

Without this, the button is enabled if no entry at all is selected (e.g.
when switching to the 'User Management' tab), with the button then
(obviously) being a noop.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
7 weeks agotests: replace static mut with a mutex
Wolfgang Bumiller [Thu, 29 Aug 2024 09:40:48 +0000 (11:40 +0200)]
tests: replace static mut with a mutex

rustc warns about creating references to them (although it does allow
using `.as_ref()` on them for some reason), and this will become a
hard error with edition 2024.

Previously we could not use Mutex there as its ::new() was not a
`const fn` , but not we can, so let's drop the `mut`.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
7 weeks agolog: retrieve `ReaderEnvironment` debug flag from tracing
Gabriel Goller [Fri, 16 Aug 2024 10:39:58 +0000 (12:39 +0200)]
log: retrieve `ReaderEnvironment` debug flag from tracing

Don't hardcode the debug flag but retrieve the currently enabled level
using tracing. This will change the default log-behavior and disable
some logs that have been printed previously. F.e.: the "protocol upgrade
done" message is not visible anymore per default because it is printed
with debug.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
2 months agobump d/control
Wolfgang Bumiller [Wed, 14 Aug 2024 10:15:40 +0000 (12:15 +0200)]
bump d/control

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 months agocargo: remove unused dependencies
Maximiliano Sandoval [Wed, 14 Aug 2024 09:21:14 +0000 (11:21 +0200)]
cargo: remove unused dependencies

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2 months agobackup-client: remove unused dependencies
Maximiliano Sandoval [Wed, 14 Aug 2024 09:21:13 +0000 (11:21 +0200)]
backup-client: remove unused dependencies

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2 months agopxar-bin: remove unused dependencies
Maximiliano Sandoval [Wed, 14 Aug 2024 09:21:12 +0000 (11:21 +0200)]
pxar-bin: remove unused dependencies

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2 months agorestore-daemon: remove unused dependencies
Maximiliano Sandoval [Wed, 14 Aug 2024 09:21:11 +0000 (11:21 +0200)]
restore-daemon: remove unused dependencies

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2 months agofile-restore: remove unused deps
Maximiliano Sandoval [Wed, 14 Aug 2024 09:21:10 +0000 (11:21 +0200)]
file-restore: remove unused deps

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2 months agoclient: remove unused deps
Maximiliano Sandoval [Wed, 14 Aug 2024 09:21:09 +0000 (11:21 +0200)]
client: remove unused deps

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2 months agotools: remove unused dependencies
Maximiliano Sandoval [Wed, 14 Aug 2024 09:21:08 +0000 (11:21 +0200)]
tools: remove unused dependencies

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2 months agobackup: remove lazy_static dependency
Maximiliano Sandoval [Tue, 13 Aug 2024 08:44:15 +0000 (10:44 +0200)]
backup: remove lazy_static dependency

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2 months agorestore-daemon: remove lazy_static dependency
Maximiliano Sandoval [Tue, 13 Aug 2024 08:44:14 +0000 (10:44 +0200)]
restore-daemon: remove lazy_static dependency

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2 months agodatastore: remove lazy_static dependency
Maximiliano Sandoval [Tue, 13 Aug 2024 08:44:13 +0000 (10:44 +0200)]
datastore: remove lazy_static dependency

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2 months agofuse-loop: remove lazy_static dependency
Maximiliano Sandoval [Tue, 13 Aug 2024 08:44:12 +0000 (10:44 +0200)]
fuse-loop: remove lazy_static dependency

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2 months agotape: remove lazy_static dependency
Maximiliano Sandoval [Tue, 13 Aug 2024 08:44:11 +0000 (10:44 +0200)]
tape: remove lazy_static dependency

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2 months agoconfig: remove lazy_static dependency
Maximiliano Sandoval [Tue, 13 Aug 2024 08:44:10 +0000 (10:44 +0200)]
config: remove lazy_static dependency

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2 months agocargo: declare msrv
Maximiliano Sandoval [Tue, 13 Aug 2024 08:44:09 +0000 (10:44 +0200)]
cargo: declare msrv

In the following commit we will make use of std::sync::LazyLock which
was introduced in rust 1.80.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2 months agotools: remove unused lazy_static dependency
Maximiliano Sandoval [Tue, 13 Aug 2024 08:44:08 +0000 (10:44 +0200)]
tools: remove unused lazy_static dependency

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2 months agoclient: remove unused lazy_static dependency
Maximiliano Sandoval [Tue, 13 Aug 2024 08:44:07 +0000 (10:44 +0200)]
client: remove unused lazy_static dependency

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2 months agoapi-types: remove unused lazy_static dependency
Maximiliano Sandoval [Tue, 13 Aug 2024 08:44:06 +0000 (10:44 +0200)]
api-types: remove unused lazy_static dependency

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2 months agobump d/control
Wolfgang Bumiller [Fri, 9 Aug 2024 11:06:32 +0000 (13:06 +0200)]
bump d/control

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 months agobump proxmox-rrd dep to 0.3
Wolfgang Bumiller [Fri, 9 Aug 2024 11:06:25 +0000 (13:06 +0200)]
bump proxmox-rrd dep to 0.3

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 months agoapi-types: rrd: use api-types from proxmox-rrd
Lukas Wagner [Tue, 6 Aug 2024 12:59:56 +0000 (14:59 +0200)]
api-types: rrd: use api-types from proxmox-rrd

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2 months agorrd_cache: use new callback for RRD creation
Lukas Wagner [Tue, 6 Aug 2024 12:59:55 +0000 (14:59 +0200)]
rrd_cache: use new callback for RRD creation

Some changes in `promox-rrd` now require a separate callback for
creating a new RRD.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2 months agodaily-update: initialize context for notification system
Lukas Wagner [Fri, 9 Aug 2024 08:19:50 +0000 (10:19 +0200)]
daily-update: initialize context for notification system

Otherwise proxmox-daily-update panics if attempting to send a
notification for any available new updates:

  "context for proxmox-notify has not been set yet"

Reported on our community forum:
https://forum.proxmox.com/threads/152429/

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2 months agobackup: use proxmox-systemd crate
Thomas Lamprecht [Wed, 7 Aug 2024 18:53:48 +0000 (20:53 +0200)]
backup: use proxmox-systemd crate

Some systemd code got split out from proxmox-sys and left there
re-exported with a deprecation marker, use the newer crate, the
workspace already depends on proxmox-systemd anyway.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agofile restore: use proxmox-systemd crate
Thomas Lamprecht [Wed, 7 Aug 2024 18:53:18 +0000 (20:53 +0200)]
file restore: use proxmox-systemd crate

Some systemd code got split out from proxmox-sys and left there
re-exported with a deprecation marker, use the newer crate, the
workspace already depends on proxmox-systemd anyway.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agoclient: use proxmox_systemd crate
Thomas Lamprecht [Wed, 7 Aug 2024 18:51:20 +0000 (20:51 +0200)]
client: use proxmox_systemd crate

Some systemd code got split out from proxmox-sys and left there
re-exported with a deprecation marker, use the newer crate, the
workspace already depends on proxmox-systemd anyway.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agocargo fmt
Thomas Lamprecht [Wed, 7 Aug 2024 18:50:28 +0000 (20:50 +0200)]
cargo fmt

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agodatastore: data blob encode: simplify code
Dominik Csapak [Mon, 5 Aug 2024 09:24:14 +0000 (11:24 +0200)]
datastore: data blob encode: simplify code

by combining the compression call from both encrypted and unencrypted
paths and deciding on the header magic at one site.

No functional changes intended, besides reusing the same buffer for
compression.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 months agodatastore: data blob: increase compression throughput
Dominik Csapak [Mon, 5 Aug 2024 09:24:13 +0000 (11:24 +0200)]
datastore: data blob: increase compression throughput

Increase the zstd compression throughput by not using the
`zstd::stream::copy_encode` method, because it seems it uses an
internal buffer size of 32 KiB [0], copies at least once extra in the
target buffer and might have some additional (allocation and/or
syscall) overhead. Due to the amount of wrappers and indirections it's
a bit hard to tell for sure.  In anyway, there can be a reduced
throughput observed if all, the target and source storage and the
network are so fast that the operations from creating chunks, like
compressions, can become the bottleneck.

Instead use the lower-level `zstd_safe::compress` which avoids (big)
allocations, since we provide the target buffer.

In case of a compression error just return the uncompressed data,
there's nothing we can do and saving uncompressed data is better than
having none. Additionally, log any such error besides the one for the
target buffer being too small.

Some benchmarks on my machine (Intel i7-12700K with DDR5-4800 memory
using a ASUS Prime Z690-A motherboard) from a tmpfs to a datastore on
tmpfs:

Type                without patches (MiB/s)  with patches (MiB/s)
.img file           ~614                     ~767
pxar one big file   ~657                     ~807
pxar small files    ~576                     ~627

The new approach is faster by a factor of 1.19.

Note that the new approach should not have a measurable negative
impact, e.g. (peak) memory usage wise. That is because we always
reserved a vector with max-data-size (data length + header length) and
thus did not have to add a new buffer, rather we actually removed the
buffer that the high-level zstd wrapper crate used internally.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 months agodatastore: data blob: allow checking for zstd internal buffer-to-small error
Dominik Csapak [Mon, 5 Aug 2024 09:24:12 +0000 (11:24 +0200)]
datastore: data blob: allow checking for zstd internal buffer-to-small error

We want to check the error code of zstd not to be 'Destination buffer
to small' (dstSize_tooSmall),  but currently there is no practical API
that is also public. So we introduce a helper that uses the internal
logic of zstd to determine the error.

Since this is not guaranteed to be a stable api, add a test for that
so we catch that error early on build. This should be fine, as long as
the zstd behavior only changes with e.g. major debian upgrades, which
is normally the only time where the zstd version is updated.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
 [ TL: re-order fn, rename test and reword comments ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agodatastore: test DataBlob encode/decode roundtrip
Dominik Csapak [Mon, 5 Aug 2024 09:24:11 +0000 (11:24 +0200)]
datastore: test DataBlob encode/decode roundtrip

so that we can be sure we can decode an encoded blob again

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 months agodatastore: remove unused data blob writer
Dominik Csapak [Mon, 5 Aug 2024 09:24:10 +0000 (11:24 +0200)]
datastore: remove unused data blob writer

This is leftover code that is not currently used outside of its own
tests.

Should we need it again, we can just revert this commit.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 months agofix typos in variables and function names
Maximiliano Sandoval [Wed, 7 Aug 2024 12:10:45 +0000 (14:10 +0200)]
fix typos in variables and function names

Variables, methods and functions in public API were not changed.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2 months agofix typos in strings
Maximiliano Sandoval [Wed, 7 Aug 2024 12:10:44 +0000 (14:10 +0200)]
fix typos in strings

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2 months agofix typos in docs an manual pages
Maximiliano Sandoval [Wed, 7 Aug 2024 12:10:43 +0000 (14:10 +0200)]
fix typos in docs an manual pages

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2 months agofix typos in rust documentation blocks
Maximiliano Sandoval [Wed, 7 Aug 2024 12:10:42 +0000 (14:10 +0200)]
fix typos in rust documentation blocks

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2 months agofix typos in comments
Maximiliano Sandoval [Wed, 7 Aug 2024 12:10:41 +0000 (14:10 +0200)]
fix typos in comments

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2 months agodocs: add external metrics server page
Gabriel Goller [Wed, 7 Aug 2024 12:37:36 +0000 (14:37 +0200)]
docs: add external metrics server page

Add External Metrics page to PBS's documentation. Most of it is copied
from the PVE documentation, minus the Graphite part.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
2 months agoreplace proxmox_sys::systemd with proxmox_systemd calls
Wolfgang Bumiller [Tue, 6 Aug 2024 12:13:58 +0000 (14:13 +0200)]
replace proxmox_sys::systemd with proxmox_systemd calls

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 months agobump h2 to 0.4
Fabian Grünbichler [Thu, 25 Jul 2024 11:06:54 +0000 (13:06 +0200)]
bump h2 to 0.4

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 months agoremove use of proxmox_lang::error::io_err_other
Wolfgang Bumiller [Fri, 26 Jul 2024 10:17:09 +0000 (12:17 +0200)]
remove use of proxmox_lang::error::io_err_other

by now its functionality is provided by std::io::Error::other

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 months agoupdate to proxmox-log 0.2 and proxmox-rest-server 0.7
Wolfgang Bumiller [Wed, 24 Jul 2024 12:34:56 +0000 (14:34 +0200)]
update to proxmox-log 0.2 and proxmox-rest-server 0.7

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 months agoclient: avoid unnecessary allocation in AES benchmark
Dietmar Maurer [Fri, 19 Jul 2024 10:01:15 +0000 (12:01 +0200)]
client: avoid unnecessary allocation in AES benchmark

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agoimage backup: use 4M input buffer
Fabian Grünbichler [Wed, 17 Jul 2024 13:08:27 +0000 (15:08 +0200)]
image backup: use 4M input buffer

with the default 8k input buffer size, the client will spend most of the time
polling instead of reading/chunking/uploading.

tested with 16G random data file from tmpfs to fresh datastore backed by tmpfs,
without encryption.

stock:

Time (mean ± σ):     36.064 s ±  0.655 s    [User: 21.079 s, System: 26.415 s]
  Range (min … max):   35.663 s … 36.819 s    3 runs

patched:

 Time (mean ± σ):     23.591 s ±  0.807 s    [User: 16.532 s, System: 18.629 s]
  Range (min … max):   22.663 s … 24.125 s    3 runs

Summary
  patched ran
    1.53 ± 0.06 times faster than stock

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 months agoexample: improve chunking speed example
Fabian Grünbichler [Wed, 17 Jul 2024 13:08:26 +0000 (15:08 +0200)]
example: improve chunking speed example

by dropping the print-per-chunk and making the input buffer size configurable
(8k is the default when using `new()`).

this allows benchmarking various input buffer sizes. basically the same code is
used for image-based backups in proxmox-backup-client, but just the
reading and chunking part. looking at the flame graphs the smaller input
buffer sizes clearly show most of time spent polling, instead of
reading+copying (or reading and scanning and copying).

for a fixed chunk size stream with a 16G input file on tmpfs:

fixed 1M ran
    1.06 ± 0.17 times faster than fixed 4M
    1.22 ± 0.11 times faster than fixed 16M
    1.25 ± 0.09 times faster than fixed 512k
    1.31 ± 0.10 times faster than fixed 256k
    1.55 ± 0.13 times faster than fixed 128k
    1.92 ± 0.15 times faster than fixed 64k
    3.09 ± 0.31 times faster than fixed 32k
    4.76 ± 0.32 times faster than fixed 16k
    8.08 ± 0.59 times faster than fixed 8k

(from 15.275s down to 1.890s)

dynamic chunk stream, same input:

dynamic 4M ran
    1.01 ± 0.03 times faster than dynamic 1M
    1.03 ± 0.03 times faster than dynamic 16M
    1.06 ± 0.04 times faster than dynamic 512k
    1.07 ± 0.03 times faster than dynamic 128k
    1.12 ± 0.03 times faster than dynamic 64k
    1.15 ± 0.20 times faster than dynamic 256k
    1.23 ± 0.03 times faster than dynamic 32k
    1.47 ± 0.04 times faster than dynamic 16k
    1.92 ± 0.05 times faster than dynamic 8k

(from 26.5s down to 13.772s)

same input file on ext4 on LVM on CT2000P5PSSD8 (with caches dropped for each run):

fixed 4M ran
   1.06 ± 0.02 times faster than fixed 16M
   1.10 ± 0.01 times faster than fixed 1M
   1.12 ± 0.01 times faster than fixed 512k
   1.15 ± 0.02 times faster than fixed 128k
   1.17 ± 0.01 times faster than fixed 256k
   1.22 ± 0.02 times faster than fixed 64k
   1.55 ± 0.05 times faster than fixed 32k
   2.00 ± 0.07 times faster than fixed 16k
   3.01 ± 0.15 times faster than fixed 8k

(from 19.807s down to 6.574s)

dynamic 4M ran
    1.04 ± 0.02 times faster than dynamic 512k
    1.04 ± 0.02 times faster than dynamic 128k
    1.04 ± 0.02 times faster than dynamic 16M
    1.06 ± 0.02 times faster than dynamic 1M
    1.06 ± 0.02 times faster than dynamic 256k
    1.08 ± 0.02 times faster than dynamic 64k
    1.16 ± 0.02 times faster than dynamic 32k
    1.34 ± 0.03 times faster than dynamic 16k
    1.70 ± 0.04 times faster than dynamic 8k

(from 31.184s down to 18.378s)

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 months agobuild: ensure wrapper config is picked up
Fabian Grünbichler [Wed, 10 Jul 2024 12:29:24 +0000 (14:29 +0200)]
build: ensure wrapper config is picked up

`cargo build` and `cargo install` pick up different config files, by symlinking
the wrapper config into a place with higher precedence than the one in the
top-level git repo dir, we ensure the package build actually picks up the
desired config instead of the one intended for quick dev builds.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 months agoserver: pull: fix sync info message for root namespace
Christian Ebner [Mon, 15 Jul 2024 10:15:43 +0000 (12:15 +0200)]
server: pull: fix sync info message for root namespace

The root namespace is displayed as empty string when used in the
format string. Distinguish and explicitly write out the root namespace
in the sync info message shown in the sync jobs task log.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
3 months agowww: sync edit: indetation style fix
Christian Ebner [Mon, 15 Jul 2024 10:15:42 +0000 (12:15 +0200)]
www: sync edit: indetation style fix

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
3 months agoserver: pull: silence clippy to many arguments warning
Christian Ebner [Mon, 15 Jul 2024 10:15:41 +0000 (12:15 +0200)]
server: pull: silence clippy to many arguments warning

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
3 months agoserver: pull: be more specific in module comment
Christian Ebner [Mon, 15 Jul 2024 10:15:40 +0000 (12:15 +0200)]
server: pull: be more specific in module comment

Describe the `pull` direction of the sync operation more precisely
before adding also a `push` direction as synchronization operation.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
3 months agodatastore: data blob: fix typos in comments
Christian Ebner [Mon, 15 Jul 2024 10:15:39 +0000 (12:15 +0200)]
datastore: data blob: fix typos in comments

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
3 months agoapi certs: run cargo fmt
Thomas Lamprecht [Wed, 17 Jul 2024 11:28:05 +0000 (13:28 +0200)]
api certs: run cargo fmt

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>