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
22f2b39c
Commit
22f2b39c
authored
Dec 06, 2017
by
Eugene Kosov
Committed by
Sergey Vojtovich
Dec 19, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix data races in rwlock
parent
ca9ed393
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
7 additions
and
46 deletions
+7
-46
mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result
...l-test/suite/innodb/r/innodb_skip_innodb_is_tables.result
+1
-1
storage/innobase/handler/i_s.cc
storage/innobase/handler/i_s.cc
+3
-21
storage/innobase/handler/i_s.h
storage/innobase/handler/i_s.h
+3
-5
storage/innobase/include/sync0rw.h
storage/innobase/include/sync0rw.h
+0
-6
storage/innobase/include/sync0rw.ic
storage/innobase/include/sync0rw.ic
+0
-5
storage/innobase/sync/sync0arr.cc
storage/innobase/sync/sync0arr.cc
+0
-6
storage/innobase/sync/sync0rw.cc
storage/innobase/sync/sync0rw.cc
+0
-2
No files found.
mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result
View file @
22f2b39c
...
@@ -395,6 +395,6 @@ NAME CREATE_FILE CREATE_LINE OS_WAITS
...
@@ -395,6 +395,6 @@ NAME CREATE_FILE CREATE_LINE OS_WAITS
Warnings:
Warnings:
Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_mutexes but the InnoDB storage engine is not installed
Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_mutexes but the InnoDB storage engine is not installed
select * from information_schema.innodb_sys_semaphore_waits;
select * from information_schema.innodb_sys_semaphore_waits;
THREAD_ID OBJECT_NAME FILE LINE WAIT_TIME WAIT_OBJECT WAIT_TYPE HOLDER_THREAD_ID HOLDER_FILE HOLDER_LINE CREATED_FILE CREATED_LINE WRITER_THREAD RESERVATION_MODE READERS WAITERS_FLAG LOCK_WORD LAST_
READER_FILE LAST_READER_LINE LAST_
WRITER_FILE LAST_WRITER_LINE OS_WAIT_COUNT
THREAD_ID OBJECT_NAME FILE LINE WAIT_TIME WAIT_OBJECT WAIT_TYPE HOLDER_THREAD_ID HOLDER_FILE HOLDER_LINE CREATED_FILE CREATED_LINE WRITER_THREAD RESERVATION_MODE READERS WAITERS_FLAG LOCK_WORD LAST_WRITER_FILE LAST_WRITER_LINE OS_WAIT_COUNT
Warnings:
Warnings:
Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_sys_semaphore_waits but the InnoDB storage engine is not installed
Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_sys_semaphore_waits but the InnoDB storage engine is not installed
storage/innobase/handler/i_s.cc
View file @
22f2b39c
...
@@ -9462,25 +9462,7 @@ static ST_FIELD_INFO innodb_sys_semaphore_waits_fields_info[] =
...
@@ -9462,25 +9462,7 @@ static ST_FIELD_INFO innodb_sys_semaphore_waits_fields_info[] =
STRUCT_FLD
(
old_name
,
""
),
STRUCT_FLD
(
old_name
,
""
),
STRUCT_FLD
(
open_method
,
SKIP_OPEN_TABLE
)},
STRUCT_FLD
(
open_method
,
SKIP_OPEN_TABLE
)},
// SYS_SEMAPHORE_WAITS_LAST_READER_FILE 17
// SYS_SEMAPHORE_WAITS_LAST_WRITER_FILE 17
{
STRUCT_FLD
(
field_name
,
"LAST_READER_FILE"
),
STRUCT_FLD
(
field_length
,
OS_FILE_MAX_PATH
),
STRUCT_FLD
(
field_type
,
MYSQL_TYPE_STRING
),
STRUCT_FLD
(
value
,
0
),
STRUCT_FLD
(
field_flags
,
MY_I_S_MAYBE_NULL
),
STRUCT_FLD
(
old_name
,
""
),
STRUCT_FLD
(
open_method
,
SKIP_OPEN_TABLE
)},
// SYS_SEMAPHORE_WAITS_LAST_READER_LINE 18
{
STRUCT_FLD
(
field_name
,
"LAST_READER_LINE"
),
STRUCT_FLD
(
field_length
,
MY_INT32_NUM_DECIMAL_DIGITS
),
STRUCT_FLD
(
field_type
,
MYSQL_TYPE_LONG
),
STRUCT_FLD
(
value
,
0
),
STRUCT_FLD
(
field_flags
,
MY_I_S_UNSIGNED
),
STRUCT_FLD
(
old_name
,
""
),
STRUCT_FLD
(
open_method
,
SKIP_OPEN_TABLE
)},
// SYS_SEMAPHORE_WAITS_LAST_WRITER_FILE 19
{
STRUCT_FLD
(
field_name
,
"LAST_WRITER_FILE"
),
{
STRUCT_FLD
(
field_name
,
"LAST_WRITER_FILE"
),
STRUCT_FLD
(
field_length
,
OS_FILE_MAX_PATH
),
STRUCT_FLD
(
field_length
,
OS_FILE_MAX_PATH
),
STRUCT_FLD
(
field_type
,
MYSQL_TYPE_STRING
),
STRUCT_FLD
(
field_type
,
MYSQL_TYPE_STRING
),
...
@@ -9489,7 +9471,7 @@ static ST_FIELD_INFO innodb_sys_semaphore_waits_fields_info[] =
...
@@ -9489,7 +9471,7 @@ static ST_FIELD_INFO innodb_sys_semaphore_waits_fields_info[] =
STRUCT_FLD
(
old_name
,
""
),
STRUCT_FLD
(
old_name
,
""
),
STRUCT_FLD
(
open_method
,
SKIP_OPEN_TABLE
)},
STRUCT_FLD
(
open_method
,
SKIP_OPEN_TABLE
)},
// SYS_SEMAPHORE_WAITS_LAST_WRITER_LINE
20
// SYS_SEMAPHORE_WAITS_LAST_WRITER_LINE
18
{
STRUCT_FLD
(
field_name
,
"LAST_WRITER_LINE"
),
{
STRUCT_FLD
(
field_name
,
"LAST_WRITER_LINE"
),
STRUCT_FLD
(
field_length
,
MY_INT32_NUM_DECIMAL_DIGITS
),
STRUCT_FLD
(
field_length
,
MY_INT32_NUM_DECIMAL_DIGITS
),
STRUCT_FLD
(
field_type
,
MYSQL_TYPE_LONG
),
STRUCT_FLD
(
field_type
,
MYSQL_TYPE_LONG
),
...
@@ -9498,7 +9480,7 @@ static ST_FIELD_INFO innodb_sys_semaphore_waits_fields_info[] =
...
@@ -9498,7 +9480,7 @@ static ST_FIELD_INFO innodb_sys_semaphore_waits_fields_info[] =
STRUCT_FLD
(
old_name
,
""
),
STRUCT_FLD
(
old_name
,
""
),
STRUCT_FLD
(
open_method
,
SKIP_OPEN_TABLE
)},
STRUCT_FLD
(
open_method
,
SKIP_OPEN_TABLE
)},
// SYS_SEMAPHORE_WAITS_OS_WAIT_COUNT
21
// SYS_SEMAPHORE_WAITS_OS_WAIT_COUNT
19
{
STRUCT_FLD
(
field_name
,
"OS_WAIT_COUNT"
),
{
STRUCT_FLD
(
field_name
,
"OS_WAIT_COUNT"
),
STRUCT_FLD
(
field_length
,
MY_INT32_NUM_DECIMAL_DIGITS
),
STRUCT_FLD
(
field_length
,
MY_INT32_NUM_DECIMAL_DIGITS
),
STRUCT_FLD
(
field_type
,
MYSQL_TYPE_LONG
),
STRUCT_FLD
(
field_type
,
MYSQL_TYPE_LONG
),
...
...
storage/innobase/handler/i_s.h
View file @
22f2b39c
...
@@ -127,11 +127,9 @@ HPUX aCC: HP ANSI C++ B3910B A.03.65) can't handle it. */
...
@@ -127,11 +127,9 @@ HPUX aCC: HP ANSI C++ B3910B A.03.65) can't handle it. */
#define SYS_SEMAPHORE_WAITS_READERS 14
#define SYS_SEMAPHORE_WAITS_READERS 14
#define SYS_SEMAPHORE_WAITS_WAITERS_FLAG 15
#define SYS_SEMAPHORE_WAITS_WAITERS_FLAG 15
#define SYS_SEMAPHORE_WAITS_LOCK_WORD 16
#define SYS_SEMAPHORE_WAITS_LOCK_WORD 16
#define SYS_SEMAPHORE_WAITS_LAST_READER_FILE 17
#define SYS_SEMAPHORE_WAITS_LAST_WRITER_FILE 17
#define SYS_SEMAPHORE_WAITS_LAST_READER_LINE 18
#define SYS_SEMAPHORE_WAITS_LAST_WRITER_LINE 18
#define SYS_SEMAPHORE_WAITS_LAST_WRITER_FILE 19
#define SYS_SEMAPHORE_WAITS_OS_WAIT_COUNT 19
#define SYS_SEMAPHORE_WAITS_LAST_WRITER_LINE 20
#define SYS_SEMAPHORE_WAITS_OS_WAIT_COUNT 21
/*******************************************************************//**
/*******************************************************************//**
Auxiliary function to store ulint value in MYSQL_TYPE_LONGLONG field.
Auxiliary function to store ulint value in MYSQL_TYPE_LONGLONG field.
...
...
storage/innobase/include/sync0rw.h
View file @
22f2b39c
...
@@ -603,9 +603,6 @@ struct rw_lock_t
...
@@ -603,9 +603,6 @@ struct rw_lock_t
/** File name where lock created */
/** File name where lock created */
const
char
*
cfile_name
;
const
char
*
cfile_name
;
/** last s-lock file/line is not guaranteed to be correct */
const
char
*
last_s_file_name
;
/** File name where last x-locked */
/** File name where last x-locked */
const
char
*
last_x_file_name
;
const
char
*
last_x_file_name
;
...
@@ -615,9 +612,6 @@ struct rw_lock_t
...
@@ -615,9 +612,6 @@ struct rw_lock_t
/** If 1 then the rw-lock is a block lock */
/** If 1 then the rw-lock is a block lock */
unsigned
is_block_lock
:
1
;
unsigned
is_block_lock
:
1
;
/** Line number where last time s-locked */
unsigned
last_s_line
:
14
;
/** Line number where last time x-locked */
/** Line number where last time x-locked */
unsigned
last_x_line
:
14
;
unsigned
last_x_line
:
14
;
...
...
storage/innobase/include/sync0rw.ic
View file @
22f2b39c
...
@@ -249,11 +249,6 @@ rw_lock_s_lock_low(
...
@@ -249,11 +249,6 @@ rw_lock_s_lock_low(
ut_d(rw_lock_add_debug_info(lock, pass, RW_LOCK_S, file_name, line));
ut_d(rw_lock_add_debug_info(lock, pass, RW_LOCK_S, file_name, line));
/* These debugging values are not set safely: they may be incorrect
or even refer to a line that is invalid for the file name. */
lock->last_s_file_name = file_name;
lock->last_s_line = line;
return(TRUE); /* locking succeeded */
return(TRUE); /* locking succeeded */
}
}
...
...
storage/innobase/sync/sync0arr.cc
View file @
22f2b39c
...
@@ -590,7 +590,6 @@ sync_array_cell_print(
...
@@ -590,7 +590,6 @@ sync_array_cell_print(
"number of readers "
ULINTPF
"number of readers "
ULINTPF
", waiters flag %d, "
", waiters flag %d, "
"lock_word: %x
\n
"
"lock_word: %x
\n
"
"Last time read locked in file %s line %u
\n
"
"Last time write locked in file %s line %u"
"Last time write locked in file %s line %u"
#if 0 /* JAN: TODO: FIX LATER */
#if 0 /* JAN: TODO: FIX LATER */
"\nHolder thread " ULINTPF
"\nHolder thread " ULINTPF
...
@@ -600,8 +599,6 @@ sync_array_cell_print(
...
@@ -600,8 +599,6 @@ sync_array_cell_print(
rw_lock_get_reader_count
(
rwlock
),
rw_lock_get_reader_count
(
rwlock
),
my_atomic_load32_explicit
(
&
rwlock
->
waiters
,
MY_MEMORY_ORDER_RELAXED
),
my_atomic_load32_explicit
(
&
rwlock
->
waiters
,
MY_MEMORY_ORDER_RELAXED
),
my_atomic_load32_explicit
(
&
rwlock
->
lock_word
,
MY_MEMORY_ORDER_RELAXED
),
my_atomic_load32_explicit
(
&
rwlock
->
lock_word
,
MY_MEMORY_ORDER_RELAXED
),
innobase_basename
(
rwlock
->
last_s_file_name
),
rwlock
->
last_s_line
,
innobase_basename
(
rwlock
->
last_x_file_name
),
innobase_basename
(
rwlock
->
last_x_file_name
),
rwlock
->
last_x_line
rwlock
->
last_x_line
#if 0 /* JAN: TODO: FIX LATER */
#if 0 /* JAN: TODO: FIX LATER */
...
@@ -1401,9 +1398,6 @@ sync_arr_fill_sys_semphore_waits_table(
...
@@ -1401,9 +1398,6 @@ sync_arr_fill_sys_semphore_waits_table(
my_atomic_load32_explicit
(
&
rwlock
->
waiters
,
MY_MEMORY_ORDER_RELAXED
)));
my_atomic_load32_explicit
(
&
rwlock
->
waiters
,
MY_MEMORY_ORDER_RELAXED
)));
OK
(
field_store_ulint
(
fields
[
SYS_SEMAPHORE_WAITS_LOCK_WORD
],
OK
(
field_store_ulint
(
fields
[
SYS_SEMAPHORE_WAITS_LOCK_WORD
],
my_atomic_load32_explicit
(
&
rwlock
->
lock_word
,
MY_MEMORY_ORDER_RELAXED
)));
my_atomic_load32_explicit
(
&
rwlock
->
lock_word
,
MY_MEMORY_ORDER_RELAXED
)));
OK
(
field_store_string
(
fields
[
SYS_SEMAPHORE_WAITS_LAST_READER_FILE
],
innobase_basename
(
rwlock
->
last_s_file_name
)));
OK
(
fields
[
SYS_SEMAPHORE_WAITS_LAST_READER_LINE
]
->
store
(
rwlock
->
last_s_line
,
true
));
fields
[
SYS_SEMAPHORE_WAITS_LAST_READER_LINE
]
->
set_notnull
();
OK
(
field_store_string
(
fields
[
SYS_SEMAPHORE_WAITS_LAST_WRITER_FILE
],
innobase_basename
(
rwlock
->
last_x_file_name
)));
OK
(
field_store_string
(
fields
[
SYS_SEMAPHORE_WAITS_LAST_WRITER_FILE
],
innobase_basename
(
rwlock
->
last_x_file_name
)));
OK
(
fields
[
SYS_SEMAPHORE_WAITS_LAST_WRITER_LINE
]
->
store
(
rwlock
->
last_x_line
,
true
));
OK
(
fields
[
SYS_SEMAPHORE_WAITS_LAST_WRITER_LINE
]
->
store
(
rwlock
->
last_x_line
,
true
));
fields
[
SYS_SEMAPHORE_WAITS_LAST_WRITER_LINE
]
->
set_notnull
();
fields
[
SYS_SEMAPHORE_WAITS_LAST_WRITER_LINE
]
->
set_notnull
();
...
...
storage/innobase/sync/sync0rw.cc
View file @
22f2b39c
...
@@ -239,9 +239,7 @@ rw_lock_create_func(
...
@@ -239,9 +239,7 @@ rw_lock_create_func(
ut_ad
(
cline
<=
8192
);
ut_ad
(
cline
<=
8192
);
lock
->
cline
=
cline
;
lock
->
cline
=
cline
;
lock
->
count_os_wait
=
0
;
lock
->
count_os_wait
=
0
;
lock
->
last_s_file_name
=
"not yet reserved"
;
lock
->
last_x_file_name
=
"not yet reserved"
;
lock
->
last_x_file_name
=
"not yet reserved"
;
lock
->
last_s_line
=
0
;
lock
->
last_x_line
=
0
;
lock
->
last_x_line
=
0
;
lock
->
event
=
os_event_create
(
0
);
lock
->
event
=
os_event_create
(
0
);
lock
->
wait_ex_event
=
os_event_create
(
0
);
lock
->
wait_ex_event
=
os_event_create
(
0
);
...
...
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