Skip to content
This repository was archived by the owner on Mar 1, 2026. It is now read-only.

Commit f68149e

Browse files
committed
BUG#32327411 : OFFLINE KEYRING MIGRATION FROM KEYRING_FILE REPORTS
SUCCESS, BUT MIGRATES NO KEYS Problem: For empty or non-existing keyring sources, the offline keyring migration reports success, but no appropriate warning message is shown. If the user enters a relative path for the --keyring-file-data variable, the source keyring is looked in the basedir, as offline keyring migration doesn't support relative path, entering a relative path might result in empty keyring source generation, and transferring keys from it. Fix: Now the migration process will check for any error during the key fetch , if there's no error, and there are no keys, then a warning message is shown that keyring has no keys in it. The test will try to migrate the keys from an empty keyring source, and looks for the warning message in the server log. RB#27401
1 parent f497369 commit f68149e

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

‎share/messages_to_error_log.txt‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11587,6 +11587,9 @@ ER_INVALID_TLS_VERSION
1158711587
ER_RPL_RELAY_LOG_RECOVERY_GTID_ONLY
1158811588
eng "Relay log recovery on channel with GTID_ONLY=1. The channel will switch to a new relay log and the GTID protocol will be used to replicate unapplied transactions."
1158911589

11590+
ER_WARN_MIGRATION_EMPTY_SOURCE_KEYRING
11591+
eng "Source keyring does not have any keys to migrate."
11592+
1159011593
# DO NOT add server-to-client messages here;
1159111594
# they go in messages_to_clients.txt
1159211595
# in the same directory as this file.

‎sql/migrate_keyring.cc‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,12 @@ bool Migrate_keyring::fetch_and_store_keys() {
498498
if (key) my_free((char *)key);
499499
if (key_type) my_free(key_type);
500500
}
501+
502+
/* If there are zero keys in the keyring, it means no keys were migrated */
503+
if (!error && m_source_keys.size() == 0) {
504+
LogErr(WARNING_LEVEL, ER_WARN_MIGRATION_EMPTY_SOURCE_KEYRING);
505+
}
506+
501507
if (error) {
502508
/* something went wrong remove keys from destination plugin. */
503509
while (m_source_keys.size()) {

0 commit comments

Comments
 (0)