Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
da927da0
Commit
da927da0
authored
Feb 12, 2014
by
Jan Lindström
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed issue on atomic writes and system tables. Atomic writes can be used
also on system tables but not per table.
parent
1fa19bf7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
52 deletions
+66
-52
storage/innobase/buf/buf0mtflu.cc
storage/innobase/buf/buf0mtflu.cc
+10
-4
storage/innobase/include/dict0dict.ic
storage/innobase/include/dict0dict.ic
+23
-22
storage/xtradb/buf/buf0mtflu.cc
storage/xtradb/buf/buf0mtflu.cc
+10
-4
storage/xtradb/include/dict0dict.ic
storage/xtradb/include/dict0dict.ic
+23
-22
No files found.
storage/innobase/buf/buf0mtflu.cc
View file @
da927da0
...
...
@@ -298,7 +298,7 @@ mtflush_service_io(
switch
(
work_item
->
tsk
)
{
case
MT_WRK_NONE
:
ut_a
(
work_item
->
wi_status
==
WRK_ITEM_EXIT
);
work_item
->
wi_status
=
WRK_ITEM_
SUCCESS
;
work_item
->
wi_status
=
WRK_ITEM_
EXIT
;
ib_wqueue_add
(
mtflush_io
->
wr_cq
,
work_item
,
mtflush_io
->
wheap
);
break
;
...
...
@@ -419,11 +419,17 @@ buf_mtflu_io_thread_exit(void)
work_item
=
(
wrk_t
*
)
ib_wqueue_timedwait
(
mtflush_io
->
wr_cq
,
50000
);
if
(
work_item
)
{
/* If we receive reply to work item and it's status is exit,
thead has processed this message and existed */
if
(
work_item
&&
work_item
->
wi_status
==
WRK_ITEM_EXIT
)
{
i
++
;
}
}
/* Wait about 1/2 sec to allow threads really exit */
os_thread_sleep
(
50000
);
ut_a
(
ib_wqueue_is_empty
(
mtflush_io
->
wq
));
ut_a
(
ib_wqueue_is_empty
(
mtflush_io
->
wr_cq
));
ut_a
(
ib_wqueue_is_empty
(
mtflush_io
->
rd_cq
));
...
...
@@ -432,10 +438,10 @@ buf_mtflu_io_thread_exit(void)
ib_wqueue_free
(
mtflush_io
->
wr_cq
);
ib_wqueue_free
(
mtflush_io
->
rd_cq
);
os_fast_mutex_free
(
&
mtflush_mtx
);
/* Free heap */
mem_heap_free
(
mtflush_io
->
wheap
);
os_fast_mutex_free
(
&
mtflush_mtx
);
}
/******************************************************************//**
...
...
storage/innobase/include/dict0dict.ic
View file @
da927da0
/*****************************************************************************
Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2013, SkySQL Ab. All Rights Reserved.
Copyright (c) 2013,
2014,
SkySQL Ab. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -645,6 +645,24 @@ dict_tf_is_valid(
}
}
if (atomic_writes) {
if(atomic_writes < 0 || atomic_writes > ATOMIC_WRITES_OFF) {
fprintf(stderr,
"InnoDB: Error: table flags are %ld in the data dictionary and are corrupted\n"
"InnoDB: Error: data dictionary flags are\n"
"InnoDB: compact %ld atomic_blobs %ld\n"
"InnoDB: unused %ld data_dir %ld zip_ssize %ld\n"
"InnoDB: page_compression %ld page_compression_level %ld\n"
"InnoDB: atomic_writes %ld\n",
flags, compact, atomic_blobs, unused, data_dir, zip_ssize,
page_compression, page_compression_level, atomic_writes
);
return(false);
}
}
/* CREATE TABLE ... DATA DIRECTORY is supported for any row format,
so the DATA_DIR flag is compatible with all other table flags. */
...
...
@@ -670,7 +688,8 @@ dict_sys_tables_type_validate(
ulint page_compression = DICT_TF_GET_PAGE_COMPRESSION(type);
ulint page_compression_level = DICT_TF_GET_PAGE_COMPRESSION_LEVEL(type);
ulint atomic_writes = DICT_TF_GET_ATOMIC_WRITES(type);
atomic_writes_t awrites = (atomic_writes_t)atomic_writes;
ut_a(atomic_writes >= 0 && atomic_writes <= ATOMIC_WRITES_OFF);
/* The low order bit of SYS_TABLES.TYPE is always set to 1.
If the format is UNIV_FORMAT_B or higher, this field is the same
...
...
@@ -748,16 +767,6 @@ dict_sys_tables_type_validate(
}
}
if (awrites == ATOMIC_WRITES_ON ||
(awrites == ATOMIC_WRITES_DEFAULT && srv_use_atomic_writes)) {
if (!atomic_blobs) {
fprintf(stderr, "InnoDB Error: SYS_TABLES::TYPE=%lu, atomic_writes %lu atomic_blobs %lu\n",
type, atomic_writes, atomic_blobs);
return(ULINT_UNDEFINED);
}
}
/* Return the validated SYS_TABLES.TYPE. */
return(type);
}
...
...
@@ -871,16 +880,8 @@ dict_tf_set(
ut_ad(dict_tf_get_page_compression_level(*flags) == page_compression_level);
}
if (awrites != ATOMIC_WRITES_DEFAULT) {
*flags |= (atomic_writes << DICT_TF_POS_ATOMIC_WRITES);
ut_ad(dict_tf_get_atomic_writes(*flags) == awrites);
}
if (awrites == ATOMIC_WRITES_ON ||
(awrites == ATOMIC_WRITES_DEFAULT && srv_use_atomic_writes )) {
*flags |= (atomic_writes << DICT_TF_POS_ATOMIC_WRITES)
| (1 << DICT_TF_POS_ATOMIC_BLOBS);
}
*flags |= (atomic_writes << DICT_TF_POS_ATOMIC_WRITES);
ut_ad(dict_tf_get_atomic_writes(*flags) == awrites);
if (use_data_dir) {
*flags |= (1 << DICT_TF_POS_DATA_DIR);
...
...
storage/xtradb/buf/buf0mtflu.cc
View file @
da927da0
...
...
@@ -304,7 +304,7 @@ mtflush_service_io(
switch
(
work_item
->
tsk
)
{
case
MT_WRK_NONE
:
ut_a
(
work_item
->
wi_status
==
WRK_ITEM_EXIT
);
work_item
->
wi_status
=
WRK_ITEM_
SUCCESS
;
work_item
->
wi_status
=
WRK_ITEM_
EXIT
;
ib_wqueue_add
(
mtflush_io
->
wr_cq
,
work_item
,
mtflush_io
->
wheap
);
break
;
...
...
@@ -425,11 +425,17 @@ buf_mtflu_io_thread_exit(void)
work_item
=
(
wrk_t
*
)
ib_wqueue_timedwait
(
mtflush_io
->
wr_cq
,
50000
);
if
(
work_item
)
{
/* If we receive reply to work item and it's status is exit,
thead has processed this message and existed */
if
(
work_item
&&
work_item
->
wi_status
==
WRK_ITEM_EXIT
)
{
i
++
;
}
}
/* Wait about 1/2 sec to allow threads really exit */
os_thread_sleep
(
50000
);
ut_a
(
ib_wqueue_is_empty
(
mtflush_io
->
wq
));
ut_a
(
ib_wqueue_is_empty
(
mtflush_io
->
wr_cq
));
ut_a
(
ib_wqueue_is_empty
(
mtflush_io
->
rd_cq
));
...
...
@@ -438,10 +444,10 @@ buf_mtflu_io_thread_exit(void)
ib_wqueue_free
(
mtflush_io
->
wr_cq
);
ib_wqueue_free
(
mtflush_io
->
rd_cq
);
os_fast_mutex_free
(
&
mtflush_mtx
);
/* Free heap */
mem_heap_free
(
mtflush_io
->
wheap
);
os_fast_mutex_free
(
&
mtflush_mtx
);
}
/******************************************************************//**
...
...
storage/xtradb/include/dict0dict.ic
View file @
da927da0
/*****************************************************************************
Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2013, SkySQL Ab. All Rights Reserved.
Copyright (c) 2013,
2014,
SkySQL Ab. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -649,6 +649,24 @@ dict_tf_is_valid(
}
}
if (atomic_writes) {
if(atomic_writes < 0 || atomic_writes > ATOMIC_WRITES_OFF) {
fprintf(stderr,
"InnoDB: Error: table flags are %ld in the data dictionary and are corrupted\n"
"InnoDB: Error: data dictionary flags are\n"
"InnoDB: compact %ld atomic_blobs %ld\n"
"InnoDB: unused %ld data_dir %ld zip_ssize %ld\n"
"InnoDB: page_compression %ld page_compression_level %ld\n"
"InnoDB: atomic_writes %ld\n",
flags, compact, atomic_blobs, unused, data_dir, zip_ssize,
page_compression, page_compression_level, atomic_writes
);
return(false);
}
}
/* CREATE TABLE ... DATA DIRECTORY is supported for any row format,
so the DATA_DIR flag is compatible with all other table flags. */
...
...
@@ -674,7 +692,8 @@ dict_sys_tables_type_validate(
ulint page_compression = DICT_TF_GET_PAGE_COMPRESSION(type);
ulint page_compression_level = DICT_TF_GET_PAGE_COMPRESSION_LEVEL(type);
ulint atomic_writes = DICT_TF_GET_ATOMIC_WRITES(type);
atomic_writes_t awrites = (atomic_writes_t)atomic_writes;
ut_a(atomic_writes >= 0 && atomic_writes <= ATOMIC_WRITES_OFF);
/* The low order bit of SYS_TABLES.TYPE is always set to 1.
If the format is UNIV_FORMAT_B or higher, this field is the same
...
...
@@ -752,16 +771,6 @@ dict_sys_tables_type_validate(
}
}
if (awrites == ATOMIC_WRITES_ON ||
(awrites == ATOMIC_WRITES_DEFAULT && srv_use_atomic_writes)) {
if (!atomic_blobs) {
fprintf(stderr, "InnoDB Error: SYS_TABLES::TYPE=%lu, atomic_writes %lu atomic_blobs %lu\n",
type, atomic_writes, atomic_blobs);
return(ULINT_UNDEFINED);
}
}
/* Return the validated SYS_TABLES.TYPE. */
return(type);
}
...
...
@@ -879,16 +888,8 @@ dict_tf_set(
ut_ad(dict_tf_get_page_compression_level(*flags) == page_compression_level);
}
if (awrites != ATOMIC_WRITES_DEFAULT) {
*flags |= (atomic_writes << DICT_TF_POS_ATOMIC_WRITES);
ut_ad(dict_tf_get_atomic_writes(*flags) == awrites);
}
if (awrites == ATOMIC_WRITES_ON ||
(awrites == ATOMIC_WRITES_DEFAULT && srv_use_atomic_writes )) {
*flags |= (atomic_writes << DICT_TF_POS_ATOMIC_WRITES)
| (1 << DICT_TF_POS_ATOMIC_BLOBS);
}
*flags |= (atomic_writes << DICT_TF_POS_ATOMIC_WRITES);
ut_ad(dict_tf_get_atomic_writes(*flags) == awrites);
}
/********************************************************************//**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment