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
2ad61c67
Commit
2ad61c67
authored
Mar 29, 2021
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge 10.5 into 10.6
parents
0f6f7296
e8b7fceb
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
181 additions
and
168 deletions
+181
-168
mysql-test/suite/innodb/r/group_commit_force_recovery.result
mysql-test/suite/innodb/r/group_commit_force_recovery.result
+5
-0
mysql-test/suite/innodb/t/group_commit_force_recovery-master.opt
...est/suite/innodb/t/group_commit_force_recovery-master.opt
+1
-0
mysql-test/suite/innodb/t/group_commit_force_recovery.test
mysql-test/suite/innodb/t/group_commit_force_recovery.test
+21
-0
sql/handler.cc
sql/handler.cc
+3
-4
sql/handler.h
sql/handler.h
+2
-2
sql/sql_prepare.cc
sql/sql_prepare.cc
+5
-3
storage/innobase/handler/ha_innodb.cc
storage/innobase/handler/ha_innodb.cc
+134
-144
storage/innobase/include/ha_prototypes.h
storage/innobase/include/ha_prototypes.h
+0
-10
storage/innobase/log/log0log.cc
storage/innobase/log/log0log.cc
+8
-2
storage/rocksdb/ha_rocksdb.cc
storage/rocksdb/ha_rocksdb.cc
+2
-3
No files found.
mysql-test/suite/innodb/r/group_commit_force_recovery.result
0 → 100644
View file @
2ad61c67
CREATE TABLE t1(a int) ENGINE=InnoDB;
INSERT INTO t1 SET a=1;
RESET MASTER;
DROP TABLE t1;
End of the tests.
mysql-test/suite/innodb/t/group_commit_force_recovery-master.opt
0 → 100644
View file @
2ad61c67
--innodb-force-recovery=2
mysql-test/suite/innodb/t/group_commit_force_recovery.test
0 → 100644
View file @
2ad61c67
# MDEV-24302 RESET MASTER hangs as Innodb does not report on binlog checkpoint
# Testing binlog checkpoint notification works under stringent condition
# set by innodb_force_recovery = 2.
--
source
include
/
have_innodb
.
inc
--
source
include
/
have_binlog_format_mixed
.
inc
# Binlog checkpoint notification consumers such as RESET MASTER
# receive one when lsn_0 at the time of the request is finally gets flushed
# flush_lsn >= lsn_0
# The bug situation was that when lsn_0 reflects a write of an internal innodb trx
# and RESET MASTER was not followed by any more user transaction
# it would hang.
CREATE
TABLE
t1
(
a
int
)
ENGINE
=
InnoDB
;
INSERT
INTO
t1
SET
a
=
1
;
RESET
MASTER
;
# final cleanup
DROP
TABLE
t1
;
--
echo
End
of
the
tests
.
sql/handler.cc
View file @
2ad61c67
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates.
Copyright (c) 2009, 202
0
, MariaDB Corporation.
Copyright (c) 2009, 202
1
, MariaDB Corporation.
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
...
...
@@ -861,7 +861,7 @@ static my_bool commit_checkpoint_request_handlerton(THD *unused1, plugin_ref plu
void
*
cookie
=
st
->
cookie
;
if
(
st
->
pre_hook
)
(
*
st
->
pre_hook
)(
cookie
);
(
*
hton
->
commit_checkpoint_request
)(
hton
,
cookie
);
(
*
hton
->
commit_checkpoint_request
)(
cookie
);
}
return
FALSE
;
}
...
...
@@ -2437,8 +2437,7 @@ int ha_recover(HASH *commit_list)
Called by engine to notify TC that a new commit checkpoint has been reached.
See comments on handlerton method commit_checkpoint_request() for details.
*/
void
commit_checkpoint_notify_ha
(
handlerton
*
hton
,
void
*
cookie
)
void
commit_checkpoint_notify_ha
(
void
*
cookie
)
{
tc_log
->
commit_checkpoint_notify
(
cookie
);
}
...
...
sql/handler.h
View file @
2ad61c67
...
...
@@ -1477,7 +1477,7 @@ struct handlerton
recovery. It uses that to reduce the work needed for any subsequent XA
recovery process.
*/
void
(
*
commit_checkpoint_request
)(
handlerton
*
hton
,
void
*
cookie
);
void
(
*
commit_checkpoint_request
)(
void
*
cookie
);
/*
"Disable or enable checkpointing internal to the storage engine. This is
used for FLUSH TABLES WITH READ LOCK AND DISABLE CHECKPOINT to ensure that
...
...
@@ -5255,7 +5255,7 @@ void trans_register_ha(THD *thd, bool all, handlerton *ht,
const
char
*
get_canonical_filename
(
handler
*
file
,
const
char
*
path
,
char
*
tmp_path
);
void
commit_checkpoint_notify_ha
(
handlerton
*
hton
,
void
*
cookie
);
void
commit_checkpoint_notify_ha
(
void
*
cookie
);
inline
const
LEX_CSTRING
*
table_case_name
(
HA_CREATE_INFO
*
info
,
const
LEX_CSTRING
*
name
)
{
...
...
sql/sql_prepare.cc
View file @
2ad61c67
...
...
@@ -3418,15 +3418,17 @@ static void mysql_stmt_execute_common(THD *thd,
if
(
!
(
stmt
=
find_prepared_statement
(
thd
,
stmt_id
)))
{
char
llbuf
[
22
];
size_t
length
;
/*
Did not find the statement with the provided stmt_id.
Set thd->query_string with the stmt_id so the
audit plugin gets the meaningful notification.
*/
if
(
alloc_query
(
thd
,
llbuf
,
sizeof
(
llbuf
)))
length
=
(
size_t
)
(
longlong10_to_str
(
stmt_id
,
llbuf
,
10
)
-
llbuf
);
if
(
alloc_query
(
thd
,
llbuf
,
length
+
1
))
thd
->
set_query
(
0
,
0
);
my_error
(
ER_UNKNOWN_STMT_HANDLER
,
MYF
(
0
),
static_cast
<
int
>
(
sizeof
(
llbuf
))
,
llstr
(
stmt_id
,
llbuf
),
"mysqld_stmt_execute"
);
my_error
(
ER_UNKNOWN_STMT_HANDLER
,
MYF
(
0
),
(
int
)
length
,
llbuf
,
"mysqld_stmt_execute"
);
DBUG_VOID_RETURN
;
}
...
...
storage/innobase/handler/ha_innodb.cc
View file @
2ad61c67
This diff is collapsed.
Click to expand it.
storage/innobase/include/ha_prototypes.h
View file @
2ad61c67
...
...
@@ -136,16 +136,6 @@ innobase_mysql_print_thd(
uint
max_query_len
);
/*!< in: max query length to print, or 0 to
use the default max length */
/*****************************************************************//**
Log code calls this whenever log has been written and/or flushed up
to a new position. We use this to notify upper layer of a new commit
checkpoint when necessary.*/
UNIV_INTERN
void
innobase_mysql_log_notify
(
/*======================*/
ib_uint64_t
flush_lsn
);
/*!< in: LSN flushed to disk */
/** Converts a MySQL type to an InnoDB type. Note that this function returns
the 'mtype' of InnoDB. InnoDB differentiates between MySQL's old <= 4.1
VARCHAR and the new true VARCHAR in >= 5.0.3 by the 'prtype'.
...
...
storage/innobase/log/log0log.cc
View file @
2ad61c67
...
...
@@ -654,6 +654,10 @@ log_buffer_switch()
log_sys
.
buf_next_to_write
=
log_sys
.
buf_free
;
}
/** Invoke commit_checkpoint_notify_ha() to notify that outstanding
log writes have been completed. */
void
log_flush_notify
(
lsn_t
flush_lsn
);
/**
Writes log buffer to disk
which is the "write" part of log_write_up_to().
...
...
@@ -756,8 +760,10 @@ static void log_write(bool rotate_key)
start_offset
-
area_start
);
srv_stats
.
log_padded
.
add
(
pad_size
);
log_sys
.
write_lsn
=
write_lsn
;
if
(
log_sys
.
log
.
writes_are_durable
())
if
(
log_sys
.
log
.
writes_are_durable
())
{
log_sys
.
set_flushed_lsn
(
write_lsn
);
log_flush_notify
(
write_lsn
);
}
return
;
}
...
...
@@ -824,7 +830,7 @@ void log_write_up_to(lsn_t lsn, bool flush_to_disk, bool rotate_key,
log_write_flush_to_disk_low
(
flush_lsn
);
flush_lock
.
release
(
flush_lsn
);
innobase_mysql_log
_notify
(
flush_lsn
);
log_flush
_notify
(
flush_lsn
);
}
/** write to the log file up to the last log entry.
...
...
storage/rocksdb/ha_rocksdb.cc
View file @
2ad61c67
...
...
@@ -4111,15 +4111,14 @@ static int rocksdb_recover(handlerton* hton, XID* xid_list, uint len)
MariaRocks just flushes everything right away ATM
*/
static
void
rocksdb_checkpoint_request
(
handlerton
*
hton
,
void
*
cookie
)
static
void
rocksdb_checkpoint_request
(
void
*
cookie
)
{
const
rocksdb
::
Status
s
=
rdb
->
SyncWAL
();
//TODO: what to do on error?
if
(
s
.
ok
())
{
rocksdb_wal_group_syncs
++
;
commit_checkpoint_notify_ha
(
hton
,
cookie
);
commit_checkpoint_notify_ha
(
cookie
);
}
}
...
...
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