Skip to content

Commit

Permalink
Cleanup: Remove changed_pages_bitmap
Browse files Browse the repository at this point in the history
The innodb_changed_pages plugin only was part of XtraDB, never InnoDB.
It would be useful for incremental backups.
We will remove the code from mariadb-backup for now, because it cannot
serve any useful purpose until the server part has been implemented.
  • Loading branch information
dr-m committed Feb 12, 2024
1 parent 47122a6 commit 92f87f2
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 1,360 deletions.
1 change: 0 additions & 1 deletion extra/mariabackup/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ ADD_DEFINITIONS(${SSL_DEFINES})
MYSQL_ADD_EXECUTABLE(mariadb-backup
xtrabackup.cc
innobackupex.cc
changed_page_bitmap.cc
datasink.cc
ds_buffer.cc
ds_compress.cc
Expand Down
41 changes: 0 additions & 41 deletions extra/mariabackup/backup_mysql.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ mysql_flavor_t server_flavor = FLAVOR_UNKNOWN;
unsigned long mysql_server_version = 0;

/* server capabilities */
bool have_changed_page_bitmaps = false;
bool have_backup_locks = false;
bool have_lock_wait_timeout = false;
bool have_galera_enabled = false;
Expand Down Expand Up @@ -606,34 +605,6 @@ Query the server to find out what backup capabilities it supports.
bool
detect_mysql_capabilities_for_backup()
{
const char *query = "SELECT 'INNODB_CHANGED_PAGES', COUNT(*) FROM "
"INFORMATION_SCHEMA.PLUGINS "
"WHERE PLUGIN_NAME LIKE 'INNODB_CHANGED_PAGES'";
char *innodb_changed_pages = NULL;
mysql_variable vars[] = {
{"INNODB_CHANGED_PAGES", &innodb_changed_pages}, {NULL, NULL}};

if (xtrabackup_incremental) {

read_mysql_variables(mysql_connection, query, vars, true);

ut_ad(innodb_changed_pages != NULL);

have_changed_page_bitmaps = (atoi(innodb_changed_pages) == 1);

/* INNODB_CHANGED_PAGES are listed in
INFORMATION_SCHEMA.PLUGINS in MariaDB, but
FLUSH NO_WRITE_TO_BINLOG CHANGED_PAGE_BITMAPS
is not supported for versions below 10.1.6
(see MDEV-7472) */
if (server_flavor == FLAVOR_MARIADB &&
mysql_server_version < 100106) {
have_changed_page_bitmaps = false;
}

free_mysql_variables(vars);
}

/* do some sanity checks */
if (opt_galera_info && !have_galera_enabled) {
msg("--galera-info is specified on the command "
Expand Down Expand Up @@ -1997,18 +1968,6 @@ select_history()
return(true);
}

bool
flush_changed_page_bitmaps()
{
if (xtrabackup_incremental && have_changed_page_bitmaps &&
!xtrabackup_incremental_force_scan) {
xb_mysql_query(mysql_connection,
"FLUSH NO_WRITE_TO_BINLOG CHANGED_PAGE_BITMAPS", false);
}
return(true);
}


/*********************************************************************//**
Deallocate memory, disconnect from server, etc.
@return true on success. */
Expand Down
4 changes: 0 additions & 4 deletions extra/mariabackup/backup_mysql.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ extern mysql_flavor_t server_flavor;
extern unsigned long mysql_server_version;

/* server capabilities */
extern bool have_changed_page_bitmaps;
extern bool have_backup_locks;
extern bool have_lock_wait_timeout;
extern bool have_galera_enabled;
Expand Down Expand Up @@ -39,9 +38,6 @@ capture_tool_command(int argc, char **argv);
bool
select_history();

bool
flush_changed_page_bitmaps();

void
backup_cleanup();

Expand Down

0 comments on commit 92f87f2

Please sign in to comment.