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

Adds a maintenance mode for datatsores.
The type specifies what is still allowed on the ds and what is not.
Currently there are two types: read only and offline. 'read only' prevents
everything that would write something to the ds, but allows to read from
it. 'offline' prevents everything on the datastore, neither operation
that write nor operations that read form the datastore are allowed.

For the tracking of active operations on a datastore a file is created
that contains the count of active read and write operations, this file
is then checked when the maintenance mode is changed, and if there are
active operations that would conflict with the maintenance type, it
wont be updated.

An operation is considered "active" as long as the reference that is
returned by lookup_datastore is not dropped. In this implementation, the
DataStore is wrapped in a small struct that contains the type of the
operation and an Arc to the datastore struct itself, like that I can be
sure that whenever some operation finished the reference is dropped,
furthermore it was necessary to relate a datastore reference to a type
of operation. What is also covered with this approach.

I am not sure if that's the best way do that, so I am open for
suggestions on how to implement this differently, same applies for the
naming of things.


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 (5):
  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
  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       | 132 ++++++++++++++++++++-------
 pbs-datastore/src/lib.rs             |   3 +
 pbs-datastore/src/snapshot_reader.rs |   6 +-
 src/api2/admin/datastore.rs          |  48 +++++-----
 src/api2/backup/mod.rs               |   4 +-
 src/api2/config/datastore.rs         |  42 ++++++++-
 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                    |  17 +++-
 src/server/prune_job.rs              |   4 +-
 src/server/verify_job.rs             |   4 +-
 www/Makefile                         |   1 +
 www/Utils.js                         |  14 +++
 www/datastore/OptionView.js          |   9 ++
 www/window/MaintenanceOptions.js     |  72 +++++++++++++++
 24 files changed, 401 insertions(+), 83 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] 7+ messages in thread

end of thread, other threads:[~2021-11-09  8:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-08 16:46 [pbs-devel] [PATCH v3 proxmox-backup 0/5] closes #3071: maintenance mode for datastore Hannes Laimer
2021-11-08 16:46 ` [pbs-devel] [PATCH v3 proxmox-backup 1/5] pbs-api-types: add maintenance type Hannes Laimer
2021-11-08 16:46 ` [pbs-devel] [PATCH v3 proxmox-backup 2/5] pbs-datastore: add check for maintenance in lookup Hannes Laimer
2021-11-08 16:46 ` [pbs-devel] [PATCH v3 proxmox-backup 3/5] pbs-datastore: add active operations tracking Hannes Laimer
2021-11-08 16:46 ` [pbs-devel] [PATCH v3 proxmox-backup 4/5] api2: make maintenance_type updatable Hannes Laimer
2021-11-09  8:05   ` Thomas Lamprecht
2021-11-08 16:46 ` [pbs-devel] [PATCH v3 proxmox-backup 5/5] ui: add option to change the maintenance type Hannes Laimer

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