Skip to content

Conversation

BengangY
Copy link
Contributor

@BengangY BengangY commented Sep 2, 2025

Before shutting down, xapi calls xapi_pre_shutdown to execute several pre-shutdown scripts, which require the current host's UUID as a parameter.

Currently, xapi obtains this UUID in a redundant manner:

  1. It retrieves the UUID from the local inventory file.
  2. It queries the database for the host's reference using the UUID.
  3. It queries the database again for the host's UUID using the reference obtained in step 2.

Steps 2 and 3 are unnecessary since the UUID is already available from step 1. Moreover, when the master stops, the slave fails to query the database, increasing xapi shutdown times on the slave.

The solution is to directly use the UUID obtained in step 1, eliminating the redundant database queries.

Before shutting down, xapi calls `xapi_pre_shutdown` to execute several
pre-shutdown scripts, which require the current host's UUID as a
parameter.

Currently, xapi obtains this UUID in a redundant manner:
1. It retrieves the UUID from the local inventory file.
2. It queries the database for the host's reference using the UUID.
3. It queries the database again for the host's UUID using the reference
   obtained in step 2.

Steps 2 and 3 are unnecessary since the UUID is already available from
step 1. Moreover, when the master stops, the slave fails to query the
database, increasing xapi shutdown times on the slave.

The solution is to directly use the UUID obtained in step 1, eliminating
the redundant database queries.

Signed-off-by: Bengang Yuan <[email protected]>
@BengangY BengangY force-pushed the private/bengangy/CA-416351 branch from e583a5d to a57d581 Compare September 2, 2025 05:28
@BengangY BengangY marked this pull request as ready for review September 2, 2025 06:10
@BengangY
Copy link
Contributor Author

BengangY commented Sep 2, 2025

  • Don't merge this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants