public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH v4 proxmox-backup 0/6] closes #3071: maintenance mode for datastore
@ 2021-11-12 12:30 Hannes Laimer
  2021-11-12 12:30 ` [pbs-devel] [PATCH v4 proxmox-backup 1/6] pbs-api-types: add maintenance type Hannes Laimer
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: Hannes Laimer @ 2021-11-12 12:30 UTC (permalink / raw)
  To: pbs-devel

Adds maintenance mode and tracking of active reading/writing operations.
The maintenance mode prevents the start of new operations if the type of
operation they would perform on the datastore would conflict with the
maintenance type that is currently set. This check is performed when
lookup_datastore is called. Tasks only call this function once at the
beginning, therefore updating the maintenance type cannot interfere with
already running tasks.

active operations tracking:
Changed file layout to now also keep track of the pid and the counts of
operations that that pid started, like this it is possible to not count
operations that were started by a dead process, since they are also not
active anymore. Whenever the file is updated, also entries of dead
processes are removed. When the file is read, only entries of active
processes are counted.

The UI shows a spinner with the count of conflictintg tasks (the tasks
that were started before the maintenance type was updated) next to it.
As soon as all conflicting tasks are finished a checkmark appears.


v4:
 - clones are not also tracked
 - use lockfile, instead of locking the file
 - track pid of the process which started smth
 - updating maintenance mode is now always possible
 - add get_active_operations endpoint for datastore
 - ui: show count of conflicting tasks (or checkmark if no conflicting
     operations are active)

 v3, based on Dominik Csapak <d.csapak@proxmox.com>'s feedback:
 - added Operation enum(r/w), as suggested by
 - added active operation tracking
 - combine type and message into on field

v2:
 - check for maintenance now directly in lookup_datastore
 - parameter for checking is now the last acceptable maintenance type,
   description in commit msg of 2nd patch
 - ui cleanup

Hannes Laimer (6):
  pbs-api-types: add maintenance type
  pbs-datastore: add check for maintenance in lookup
  pbs-datastore: add active operations tracking
  api2: make maintenance_type updatable
  api2: add get_active_operations endpoint
  ui: add option to change the maintenance type

 pbs-api-types/src/datastore.rs       |   8 +-
 pbs-api-types/src/lib.rs             |   3 +
 pbs-api-types/src/maintenance.rs     |  83 ++++++++++
 pbs-datastore/Cargo.toml             |   1 +
 pbs-datastore/src/datastore.rs       | 222 +++++++++++++++++++++++----
 pbs-datastore/src/lib.rs             |   5 +-
 pbs-datastore/src/snapshot_reader.rs |   6 +-
 src/api2/admin/datastore.rs          |  79 +++++++---
 src/api2/backup/mod.rs               |   4 +-
 src/api2/config/datastore.rs         |   5 +
 src/api2/pull.rs                     |   4 +-
 src/api2/reader/mod.rs               |   6 +-
 src/api2/status.rs                   |   4 +-
 src/api2/tape/backup.rs              |   6 +-
 src/api2/tape/restore.rs             |   6 +-
 src/bin/proxmox-backup-api.rs        |   1 +
 src/bin/proxmox-backup-proxy.rs      |   6 +-
 src/server/mod.rs                    |  16 +-
 src/server/prune_job.rs              |   4 +-
 src/server/verify_job.rs             |   4 +-
 www/Makefile                         |   1 +
 www/Utils.js                         |  23 +++
 www/datastore/OptionView.js          |  30 ++++
 www/window/MaintenanceOptions.js     |  72 +++++++++
 24 files changed, 517 insertions(+), 82 deletions(-)
 create mode 100644 pbs-api-types/src/maintenance.rs
 create mode 100644 www/window/MaintenanceOptions.js

-- 
2.30.2





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-11-22  7:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-12 12:30 [pbs-devel] [PATCH v4 proxmox-backup 0/6] closes #3071: maintenance mode for datastore Hannes Laimer
2021-11-12 12:30 ` [pbs-devel] [PATCH v4 proxmox-backup 1/6] pbs-api-types: add maintenance type Hannes Laimer
2021-11-12 12:30 ` [pbs-devel] [PATCH v4 proxmox-backup 2/6] pbs-datastore: add check for maintenance in lookup Hannes Laimer
2021-11-12 12:30 ` [pbs-devel] [PATCH v4 proxmox-backup 3/6] pbs-datastore: add active operations tracking Hannes Laimer
2021-11-19 15:21   ` Dominik Csapak
2021-11-12 12:30 ` [pbs-devel] [PATCH v4 proxmox-backup 4/6] api2: make maintenance_type updatable Hannes Laimer
2021-11-12 12:30 ` [pbs-devel] [PATCH v4 proxmox-backup 5/6] api2: add get_active_operations endpoint Hannes Laimer
2021-11-12 12:30 ` [pbs-devel] [PATCH v4 proxmox-backup 6/6] ui: add option to change the maintenance type Hannes Laimer
2021-11-22  7:28 ` [pbs-devel] [PATCH v4 proxmox-backup 0/6] closes #3071: maintenance mode for datastore Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal