From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <pdm-devel-bounces@lists.proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
	by lore.proxmox.com (Postfix) with ESMTPS id 415B91FF15C
	for <inbox@lore.proxmox.com>; Wed,  5 Mar 2025 16:01:18 +0100 (CET)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
	by firstgate.proxmox.com (Proxmox) with ESMTP id BCC2C18D76;
	Wed,  5 Mar 2025 16:01:13 +0100 (CET)
From: Wolfgang Bumiller <w.bumiller@proxmox.com>
To: pdm-devel@lists.proxmox.com
Date: Wed,  5 Mar 2025 16:01:01 +0100
Message-Id: <20250305150108.245584-1-w.bumiller@proxmox.com>
X-Mailer: git-send-email 2.39.5
MIME-Version: 1.0
X-SPAM-LEVEL: Spam detection results:  0
 AWL 0.082 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DMARC_MISSING             0.1 Missing DMARC policy
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to
 Validity was blocked. See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more
 information.
 RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to
 Validity was blocked. See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more
 information.
 RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to
 Validity was blocked. See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more
 information.
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_PASS               -0.001 SPF: sender matches SPF record
 URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See
 http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more
 information. [mod.rs, main.rs, proxmox-datacenter-api.rs, connection.rs,
 lib.rs]
Subject: [pdm-devel] [PATCH pdm 0/7] multi-remote client and node
 reachability cache
X-BeenThere: pdm-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox Datacenter Manager development discussion
 <pdm-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pdm-devel>, 
 <mailto:pdm-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pdm-devel/>
List-Post: <mailto:pdm-devel@lists.proxmox.com>
List-Help: <mailto:pdm-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel>, 
 <mailto:pdm-devel-request@lists.proxmox.com?subject=subscribe>
Reply-To: Proxmox Datacenter Manager development discussion
 <pdm-devel@lists.proxmox.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: pdm-devel-bounces@lists.proxmox.com
Sender: "pdm-devel" <pdm-devel-bounces@lists.proxmox.com>

This consists of two functional parts and a tracing patch at the end.

Excerpt of the original cover letter:

1) Patches 1 through 3:
The `MultiClient` which implements cycling through multiple remotes
when requests fail due to network issues.

2) Patches 4 through 6:
A task caching the remote reachability state as well as mapping
hostnames to the pve-side node-names. Currently this simply runs every
60 seconds and goes through the current remotes+nodes and checks for
reachability.
If at that time the remote.cfg changed and the polling
task is still ongoing it will be aborted and started over with the new
config.
Finally, the reachability information will be used and updated by the
`MultiClient` implementation.

3) Patch 7 is mainly for debugging. I'm not sure whether we want to include
tracing instrumentation in general, or via a `#[cfg_attr]` or only for
debug builds...
It would probably also be nice to implicitly `#[instrument]` all the api
methods so we can follow along a trace from a specific api method.
(Currently I did this only temporarily without committing anything by
attaching, for example, a `#[instrument(name =
"api_method_list_nodes")]` attribute to the `list_nodes` api call to
more easily see the client usage via `journalctl -f
SPAN_NAME=api_method_list_nodes` on the shell...

Changes since v1:
  Only patch 1 is changed to include error messages from the last tried
  client are also logged as noted by Lukas.

Wolfgang Bumiller (7):
  server: generic multi-client wrapper
  server: store pve MultiClient for re-use
  server: separate ConnectInfo from client creation
  server: cache pve node reachability and names
  server: don't try to connect to known-unreachable servers
  server: try previously unreachable clients as last resort
  server: add some tracing instrumentation

 lib/pdm-config/src/config_version_cache.rs    |  33 +-
 server/src/api/pve/mod.rs                     |  20 +-
 .../main.rs}                                  |   3 +
 .../bin/proxmox-datacenter-api/tasks/mod.rs   |   1 +
 .../tasks/remote_node_mapping.rs              | 228 +++++++
 server/src/connection.rs                      | 641 ++++++++++++++++--
 server/src/lib.rs                             |   1 +
 server/src/remote_cache/mod.rs                | 291 ++++++++
 8 files changed, 1146 insertions(+), 72 deletions(-)
 rename server/src/bin/{proxmox-datacenter-api.rs => proxmox-datacenter-api/main.rs} (99%)
 create mode 100644 server/src/bin/proxmox-datacenter-api/tasks/mod.rs
 create mode 100644 server/src/bin/proxmox-datacenter-api/tasks/remote_node_mapping.rs
 create mode 100644 server/src/remote_cache/mod.rs

-- 
2.39.5



_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel