summaryrefslogtreecommitdiff
path: root/storage/innobase/fsp/fsp0space.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-11-27 14:49:20 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2018-11-27 14:49:39 +0200
commite82e216e374739d7cab022a86b48498aa9c33ad5 (patch)
tree1833233b74ad6cc5378f49a8b92b6417bb76332a /storage/innobase/fsp/fsp0space.cc
parenteb6364619ff807645230479bf7d2eb87d1a4edb4 (diff)
downloadmariadb-git-e82e216e374739d7cab022a86b48498aa9c33ad5.tar.gz
MDEV-17849 Undo tablespace truncation recovery fails to shrink file
fil_space_t::add(): Replaces fil_node_create(), fil_node_create_low(). Let the caller pass fil_node_t::handle, to avoid having to close and re-open files. fil_node_t::read_page0(): Refactored from fil_node_open_file(). Read the first page of a data file. fil_node_open_file(): Open the file only once. srv_undo_tablespace_open(): Set the file handle for the opened undo tablespace. This should ensure that ut_ad(file->is_open()) no longer fails in recv_add_trim(). xtrabackup_backup_func(): Remove some dead code. xb_fil_cur_open(): Open files only if needed. Undo tablespaces should already have been opened.
Diffstat (limited to 'storage/innobase/fsp/fsp0space.cc')
-rw-r--r--storage/innobase/fsp/fsp0space.cc13
1 files changed, 5 insertions, 8 deletions
diff --git a/storage/innobase/fsp/fsp0space.cc b/storage/innobase/fsp/fsp0space.cc
index df234f7274e..88b34be4952 100644
--- a/storage/innobase/fsp/fsp0space.cc
+++ b/storage/innobase/fsp/fsp0space.cc
@@ -123,18 +123,15 @@ Tablespace::open_or_create(bool is_temp)
is_temp
? FIL_TYPE_TEMPORARY : FIL_TYPE_TABLESPACE,
NULL);
+ if (!space) {
+ return DB_ERROR;
+ }
}
ut_a(fil_validate());
- /* Create the tablespace node entry for this data file. */
- if (!fil_node_create(
- it->m_filepath, it->m_size, space, false,
- TRUE)) {
-
- err = DB_ERROR;
- break;
- }
+ space->add(it->m_filepath, OS_FILE_CLOSED, it->m_size,
+ false, true);
}
return(err);