Skip to content

Commit

Permalink
PXB-3269: Jenkins fixes
Browse files Browse the repository at this point in the history
1. Dumple tablespace key has two parts. Saving the keys during the
   backup and using them during prepare. We should use keys from dump
   file during prepare only
2. Free the memory allocated by fil_path_to_space_name() using a scope
   guard
  • Loading branch information
satya-bodapati committed Oct 21, 2024
1 parent b499851 commit 86bad3f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 3 additions & 2 deletions storage/innobase/srv/srv0start.cc
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,9 @@ static dberr_t srv_undo_tablespace_read_encryption(pfs_os_file_t fh,
: set_encryption(recv_key->ptr, recv_key->iv);
} else if (is_enc) {
// Condition 2: Page is encrypted
encryption_success = use_dumped_tablespace_keys ? load_key_from_dump()
: load_key_from_page();
encryption_success = (use_dumped_tablespace_keys && !srv_backup_mode)
? load_key_from_dump()
: load_key_from_page();
} else {
// Condition 3: If the page is not encrypted, we consider it successful
encryption_success = true;
Expand Down
7 changes: 6 additions & 1 deletion storage/innobase/xtrabackup/src/ddl_tracker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,12 @@ static void copy_for_reduced(copy_thread_ctxt_t *ctxt) {
static std::string convert_file_name(const space_id_t space_id,
const std::string &file_path,
const std::string &ext) {
std::string file_name = fil_path_to_space_name(file_path.c_str());
char *space_name = fil_path_to_space_name(file_path.c_str());
auto free_guard = create_scope_guard([&]() {
if (space_name != nullptr) ut::free(space_name);
});

std::string file_name(space_name);
auto sep_pos = file_name.find_last_of(Fil_path::SEPARATOR);
return file_name.substr(0, sep_pos + 1) + std::to_string(space_id) + ext;
}
Expand Down

0 comments on commit 86bad3f

Please sign in to comment.