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
4bd94afb
Commit
4bd94afb
authored
Nov 26, 2023
by
Monty
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-32884 Make s3_debug dynamic
parent
18166e45
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
94 additions
and
5 deletions
+94
-5
mysql-test/suite/s3/debug.result
mysql-test/suite/s3/debug.result
+32
-0
mysql-test/suite/s3/debug.test
mysql-test/suite/s3/debug.test
+34
-0
storage/maria/aria_s3_copy.cc
storage/maria/aria_s3_copy.cc
+1
-1
storage/maria/ha_s3.cc
storage/maria/ha_s3.cc
+26
-3
storage/maria/libmarias3
storage/maria/libmarias3
+1
-1
No files found.
mysql-test/suite/s3/debug.result
0 → 100644
View file @
4bd94afb
drop table if exists t1;
#
# MDEV-32884 Make s3_debug dynamic
#
create or replace table t1 (a int, b int, c varchar(1000), key (a), key(c)) engine=aria;
insert into t1 select seq, seq+10, repeat(char(65+ mod(seq, 20)),mod(seq,1000)) from seq_1_to_100;
alter table t1 engine=s3;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
`c` varchar(1000) DEFAULT NULL,
KEY `a` (`a`),
KEY `c` (`c`)
) ENGINE=S3 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
select count(*) from t1;
count(*)
100
flush table t1;
NOT FOUND /storage-engine/s3_test_/ in mysqld.1.err
set @@global.s3_debug=1;
select count(*) from t1;
count(*)
100
set @@global.s3_debug=0;
FOUND 6 /storage-engine/s3_test_/ in mysqld.1.err
select count(*) from t1;
count(*)
100
drop table t1;
FOUND 6 /storage-engine/s3_test_/ in mysqld.1.err
mysql-test/suite/s3/debug.test
0 → 100644
View file @
4bd94afb
--
source
include
/
have_s3
.
inc
--
source
include
/
have_sequence
.
inc
#
# Create unique database for running the tests
#
--
source
create_database
.
inc
--
disable_warnings
drop
table
if
exists
t1
;
--
enable_warnings
--
echo
#
--
echo
# MDEV-32884 Make s3_debug dynamic
--
echo
#
create
or
replace
table
t1
(
a
int
,
b
int
,
c
varchar
(
1000
),
key
(
a
),
key
(
c
))
engine
=
aria
;
insert
into
t1
select
seq
,
seq
+
10
,
repeat
(
char
(
65
+
mod
(
seq
,
20
)),
mod
(
seq
,
1000
))
from
seq_1_to_100
;
alter
table
t1
engine
=
s3
;
show
create
table
t1
;
select
count
(
*
)
from
t1
;
flush
table
t1
;
--
let
SEARCH_FILE
=
$MYSQLTEST_VARDIR
/
log
/
mysqld
.
1.
err
--
let
SEARCH_PATTERN
=
storage
-
engine
/
s3_test_
--
source
include
/
search_pattern_in_file
.
inc
set
@@
global
.
s3_debug
=
1
;
select
count
(
*
)
from
t1
;
set
@@
global
.
s3_debug
=
0
;
--
source
include
/
search_pattern_in_file
.
inc
select
count
(
*
)
from
t1
;
drop
table
t1
;
--
source
include
/
search_pattern_in_file
.
inc
--
source
drop_database
.
inc
storage/maria/aria_s3_copy.cc
View file @
4bd94afb
...
@@ -195,7 +195,7 @@ static void get_options(int *argc, char ***argv)
...
@@ -195,7 +195,7 @@ static void get_options(int *argc, char ***argv)
my_exit
(
-
1
);
my_exit
(
-
1
);
}
}
if
(
opt_s3_debug
)
if
(
opt_s3_debug
)
ms3_debug
();
ms3_debug
(
1
);
}
/* get_options */
}
/* get_options */
...
...
storage/maria/ha_s3.cc
View file @
4bd94afb
...
@@ -121,6 +121,29 @@ static void update_secret_key(MYSQL_THD thd,
...
@@ -121,6 +121,29 @@ static void update_secret_key(MYSQL_THD thd,
}
}
}
}
static
void
update_s3_debug
(
MYSQL_THD
thd
,
struct
st_mysql_sys_var
*
var
__attribute__
((
unused
)),
void
*
var_ptr
__attribute__
((
unused
)),
const
void
*
save
)
{
char
new_state
=
*
(
char
*
)
save
;
if
(
s3_debug
!=
new_state
)
{
s3_debug
=
new_state
;
if
(
s3_hton
)
// If library is initalized
{
ms3_debug
(
new_state
);
if
(
!
new_state
)
{
/* Ensure that all logging is written to log */
fflush
(
stderr
);
}
}
}
}
/* Define system variables for S3 */
/* Define system variables for S3 */
static
MYSQL_SYSVAR_ULONG
(
block_size
,
s3_block_size
,
static
MYSQL_SYSVAR_ULONG
(
block_size
,
s3_block_size
,
...
@@ -129,9 +152,9 @@ static MYSQL_SYSVAR_ULONG(block_size, s3_block_size,
...
@@ -129,9 +152,9 @@ static MYSQL_SYSVAR_ULONG(block_size, s3_block_size,
4
*
1024
*
1024
,
65536
,
16
*
1024
*
1024
,
8192
);
4
*
1024
*
1024
,
65536
,
16
*
1024
*
1024
,
8192
);
static
MYSQL_SYSVAR_BOOL
(
debug
,
s3_debug
,
static
MYSQL_SYSVAR_BOOL
(
debug
,
s3_debug
,
PLUGIN_VAR_RQCMDARG
|
PLUGIN_VAR_READONLY
,
PLUGIN_VAR_RQCMDARG
,
"Generates trace file from libmarias3 on stderr for debugging"
,
"Generates trace file from libmarias3 on stderr for debugging"
,
0
,
0
,
0
);
0
,
update_s3_debug
,
0
);
static
MYSQL_SYSVAR_BOOL
(
slave_ignore_updates
,
s3_slave_ignore_updates
,
static
MYSQL_SYSVAR_BOOL
(
slave_ignore_updates
,
s3_slave_ignore_updates
,
PLUGIN_VAR_RQCMDARG
|
PLUGIN_VAR_READONLY
,
PLUGIN_VAR_RQCMDARG
|
PLUGIN_VAR_READONLY
,
...
@@ -1048,7 +1071,7 @@ static int ha_s3_init(void *p)
...
@@ -1048,7 +1071,7 @@ static int ha_s3_init(void *p)
s3_pagecache
.
big_block_free
=
s3_free
;
s3_pagecache
.
big_block_free
=
s3_free
;
s3_init_library
();
s3_init_library
();
if
(
s3_debug
)
if
(
s3_debug
)
ms3_debug
();
ms3_debug
(
1
);
struct
s3_func
s3f_real
=
struct
s3_func
s3f_real
=
{
{
...
...
libmarias3
@
a81724ab
Subproject commit
3846890513df0653b8919bc45a7600f9b55cab31
Subproject commit
a81724ab07bd28e16bf431419c24b6362d5894fc
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