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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
01336db3
Commit
01336db3
authored
Feb 08, 2008
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge gbichot@bk-internal.mysql.com:/home/bk/mysql-maria
into mysqlwin32.:C:/mysql-maria
parents
0a0c6041
d783c011
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
52 deletions
+52
-52
storage/maria/ma_loghandler.c
storage/maria/ma_loghandler.c
+6
-4
storage/maria/ma_loghandler.h
storage/maria/ma_loghandler.h
+6
-6
storage/maria/unittest/CMakeLists.txt
storage/maria/unittest/CMakeLists.txt
+40
-42
No files found.
storage/maria/ma_loghandler.c
View file @
01336db3
...
@@ -2798,6 +2798,7 @@ restart:
...
@@ -2798,6 +2798,7 @@ restart:
cmp_translog_addr
(
addr
,
in_buffers
)
>=
0
)
cmp_translog_addr
(
addr
,
in_buffers
)
>=
0
)
{
{
translog_lock
();
translog_lock
();
DBUG_ASSERT
(
cmp_translog_addr
(
addr
,
log_descriptor
.
horizon
)
<
0
);
/* recheck with locked loghandler */
/* recheck with locked loghandler */
in_buffers
=
translog_only_in_buffers
();
in_buffers
=
translog_only_in_buffers
();
if
(
cmp_translog_addr
(
addr
,
in_buffers
)
>=
0
)
if
(
cmp_translog_addr
(
addr
,
in_buffers
)
>=
0
)
...
@@ -2975,7 +2976,7 @@ static my_bool translog_get_last_page_addr(TRANSLOG_ADDRESS *addr,
...
@@ -2975,7 +2976,7 @@ static my_bool translog_get_last_page_addr(TRANSLOG_ADDRESS *addr,
{
{
MY_STAT
stat_buff
,
*
local_stat
;
MY_STAT
stat_buff
,
*
local_stat
;
char
path
[
FN_REFLEN
];
char
path
[
FN_REFLEN
];
uint32
rec_offset
;
uint32
rec_offset
,
file_size
;
uint32
file_no
=
LSN_FILE_NO
(
*
addr
);
uint32
file_no
=
LSN_FILE_NO
(
*
addr
);
DBUG_ENTER
(
"translog_get_last_page_addr"
);
DBUG_ENTER
(
"translog_get_last_page_addr"
);
...
@@ -2984,11 +2985,12 @@ static my_bool translog_get_last_page_addr(TRANSLOG_ADDRESS *addr,
...
@@ -2984,11 +2985,12 @@ static my_bool translog_get_last_page_addr(TRANSLOG_ADDRESS *addr,
(
no_errors
?
MYF
(
0
)
:
MYF
(
MY_WME
)))))
(
no_errors
?
MYF
(
0
)
:
MYF
(
MY_WME
)))))
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
DBUG_PRINT
(
"info"
,
(
"File size: %lu"
,
(
ulong
)
local_stat
->
st_size
));
DBUG_PRINT
(
"info"
,
(
"File size: %lu"
,
(
ulong
)
local_stat
->
st_size
));
if
(
local_stat
->
st_size
>
TRANSLOG_PAGE_SIZE
)
file_size
=
(
uint32
)
local_stat
->
st_size
;
/* st_size can be 'long' on Windows*/
if
(
file_size
>
TRANSLOG_PAGE_SIZE
)
{
{
rec_offset
=
(((
local_stat
->
st
_size
/
TRANSLOG_PAGE_SIZE
)
-
1
)
*
rec_offset
=
(((
file
_size
/
TRANSLOG_PAGE_SIZE
)
-
1
)
*
TRANSLOG_PAGE_SIZE
);
TRANSLOG_PAGE_SIZE
);
*
last_page_ok
=
(
local_stat
->
st
_size
==
rec_offset
+
TRANSLOG_PAGE_SIZE
);
*
last_page_ok
=
(
file
_size
==
rec_offset
+
TRANSLOG_PAGE_SIZE
);
}
}
else
else
{
{
...
...
storage/maria/ma_loghandler.h
View file @
01336db3
...
@@ -17,11 +17,11 @@
...
@@ -17,11 +17,11 @@
#define _ma_loghandler_h
#define _ma_loghandler_h
/* transaction log default cache size (TODO: make it global variable) */
/* transaction log default cache size (TODO: make it global variable) */
#define TRANSLOG_PAGECACHE_SIZE (1024*1024*2)
#define TRANSLOG_PAGECACHE_SIZE (1024
U
*1024*2)
/* transaction log default file size */
/* transaction log default file size */
#define TRANSLOG_FILE_SIZE (1024*1024*1024)
#define TRANSLOG_FILE_SIZE (1024
U
*1024*1024)
/* minimum possible transaction log size */
/* minimum possible transaction log size */
#define TRANSLOG_MIN_FILE_SIZE (1024*1024*8)
#define TRANSLOG_MIN_FILE_SIZE (1024
U
*1024*8)
/* transaction log default flags (TODO: make it global variable) */
/* transaction log default flags (TODO: make it global variable) */
#define TRANSLOG_DEFAULT_FLAGS 0
#define TRANSLOG_DEFAULT_FLAGS 0
...
@@ -45,7 +45,7 @@
...
@@ -45,7 +45,7 @@
It should be Power of 2 and multiple of DISK_DRIVE_SECTOR_SIZE
It should be Power of 2 and multiple of DISK_DRIVE_SECTOR_SIZE
(DISK_DRIVE_SECTOR_SIZE * 2^N)
(DISK_DRIVE_SECTOR_SIZE * 2^N)
*/
*/
#define TRANSLOG_PAGE_SIZE (8*1024)
#define TRANSLOG_PAGE_SIZE (8
U
*1024)
#include "ma_loghandler_lsn.h"
#include "ma_loghandler_lsn.h"
#include "trnman_public.h"
#include "trnman_public.h"
...
@@ -92,7 +92,7 @@ struct st_maria_handler;
...
@@ -92,7 +92,7 @@ struct st_maria_handler;
Length of disk drive sector size (we assume that writing it
Length of disk drive sector size (we assume that writing it
to disk is an atomic operation)
to disk is an atomic operation)
*/
*/
#define DISK_DRIVE_SECTOR_SIZE 512
#define DISK_DRIVE_SECTOR_SIZE 512
U
/* position reserved in an array of parts of a log record */
/* position reserved in an array of parts of a log record */
#define TRANSLOG_INTERNAL_PARTS 2
#define TRANSLOG_INTERNAL_PARTS 2
...
@@ -166,7 +166,7 @@ enum en_key_op
...
@@ -166,7 +166,7 @@ enum en_key_op
/* Size of log file; One log file is restricted to 4G */
/* Size of log file; One log file is restricted to 4G */
typedef
uint32
translog_size_t
;
typedef
uint32
translog_size_t
;
#define TRANSLOG_RECORD_HEADER_MAX_SIZE 1024
#define TRANSLOG_RECORD_HEADER_MAX_SIZE 1024
U
typedef
struct
st_translog_group_descriptor
typedef
struct
st_translog_group_descriptor
{
{
...
...
storage/maria/unittest/CMakeLists.txt
View file @
01336db3
...
@@ -20,78 +20,76 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib
...
@@ -20,78 +20,76 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib
${
CMAKE_SOURCE_DIR
}
/unittest/mytap
)
${
CMAKE_SOURCE_DIR
}
/unittest/mytap
)
LINK_LIBRARIES
(
maria myisam mytap mysys dbug strings wsock32 zlib
)
LINK_LIBRARIES
(
maria myisam mytap mysys dbug strings wsock32 zlib
)
ADD_EXECUTABLE
(
ma_test_loghandler_t
ADD_EXECUTABLE
(
ma_control_file-t ma_control_file-t.c
)
ADD_EXECUTABLE
(
trnman-t trnman-t.c
)
ADD_EXECUTABLE
(
lockman2-t lockman2-t.c
)
ADD_EXECUTABLE
(
ma_test_loghandler-t
ma_test_loghandler-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c
)
ma_test_loghandler-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c
)
ADD_EXECUTABLE
(
ma_test_loghandler_multigroup
_
t
ADD_EXECUTABLE
(
ma_test_loghandler_multigroup
-
t
ma_test_loghandler_multigroup-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c
)
ma_test_loghandler_multigroup-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c
)
ADD_EXECUTABLE
(
ma_test_loghandler_multithread
_
t
ADD_EXECUTABLE
(
ma_test_loghandler_multithread
-
t
ma_test_loghandler_multithread-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c
)
ma_test_loghandler_multithread-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c
)
ADD_EXECUTABLE
(
ma_test_loghandler_pagecache
_
t
ADD_EXECUTABLE
(
ma_test_loghandler_pagecache
-
t
ma_test_loghandler_pagecache-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c
)
ma_test_loghandler_pagecache-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c
)
ADD_EXECUTABLE
(
ma_test_loghandler_long
_t_big
ADD_EXECUTABLE
(
ma_test_loghandler_long
-t
ma_test_loghandler-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c
)
ma_test_loghandler-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c
)
SET_TARGET_PROPERTIES
(
ma_test_loghandler_long
_t_big
PROPERTIES COMPILE_FLAGS
"-DLONG_LOG_TEST"
)
SET_TARGET_PROPERTIES
(
ma_test_loghandler_long
-t
PROPERTIES COMPILE_FLAGS
"-DLONG_LOG_TEST"
)
ADD_EXECUTABLE
(
ma_test_loghandler_noflush
_
t
ADD_EXECUTABLE
(
ma_test_loghandler_noflush
-
t
ma_test_loghandler_noflush-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c
)
ma_test_loghandler_noflush-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c
)
ADD_EXECUTABLE
(
ma_test_loghandler_first_lsn
_
t
ADD_EXECUTABLE
(
ma_test_loghandler_first_lsn
-
t
ma_test_loghandler_first_lsn-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c
)
ma_test_loghandler_first_lsn-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c
)
ADD_EXECUTABLE
(
ma_test_loghandler_max_lsn
_
t
ADD_EXECUTABLE
(
ma_test_loghandler_max_lsn
-
t
ma_test_loghandler_max_lsn-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c
)
ma_test_loghandler_max_lsn-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c
)
ADD_EXECUTABLE
(
ma_test_loghandler_purge
_
t
ADD_EXECUTABLE
(
ma_test_loghandler_purge
-
t
ma_test_loghandler_purge-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c
)
ma_test_loghandler_purge-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c
)
ADD_EXECUTABLE
(
ma_test_loghandler_readonly
_
t
ADD_EXECUTABLE
(
ma_test_loghandler_readonly
-
t
ma_test_loghandler_multigroup-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c
)
ma_test_loghandler_multigroup-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c
)
SET_TARGET_PROPERTIES
(
ma_test_loghandler_readonly_t PROPERTIES COMPILE_FLAGS
"-DREADONLY_TEST"
)
SET_TARGET_PROPERTIES
(
ma_test_loghandler_readonly-t PROPERTIES COMPILE_FLAGS
"-DREADONLY_TEST"
)
ADD_EXECUTABLE
(
ma_test_loghandler_nologs-t
ma_test_loghandler_nologs-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c
)
SET
(
ma_pagecache_single_src ma_pagecache_single.c test_file.c test_file.h
)
SET
(
ma_pagecache_single_src ma_pagecache_single.c test_file.c test_file.h
)
SET
(
ma_pagecache_consist_src ma_pagecache_consist.c test_file.c test_file.h
)
SET
(
ma_pagecache_consist_src ma_pagecache_consist.c test_file.c test_file.h
)
SET
(
ma_pagecache_common_cppflags
"-DEXTRA_DEBUG -DPAGECACHE_DEBUG -DMAIN"
)
SET
(
ma_pagecache_common_cppflags
"-DEXTRA_DEBUG -DPAGECACHE_DEBUG -DMAIN"
)
ADD_EXECUTABLE
(
ma_pagecache_single_1k
_
t
${
ma_pagecache_single_src
}
)
ADD_EXECUTABLE
(
ma_pagecache_single_1k
-
t
${
ma_pagecache_single_src
}
)
SET_TARGET_PROPERTIES
(
ma_pagecache_single_1k
_
t
SET_TARGET_PROPERTIES
(
ma_pagecache_single_1k
-
t
PROPERTIES COMPILE_FLAGS
"
${
ma_pagecache_common_cppflags
}
-DPAGE_SIZE=1024"
)
PROPERTIES COMPILE_FLAGS
"
${
ma_pagecache_common_cppflags
}
-DPAGE_SIZE=1024"
)
ADD_EXECUTABLE
(
ma_pagecache_single_8k
_
t
${
ma_pagecache_single_src
}
)
ADD_EXECUTABLE
(
ma_pagecache_single_8k
-
t
${
ma_pagecache_single_src
}
)
SET_TARGET_PROPERTIES
(
ma_pagecache_single_8k
_
t
SET_TARGET_PROPERTIES
(
ma_pagecache_single_8k
-
t
PROPERTIES COMPILE_FLAGS
"
${
ma_pagecache_common_cppflags
}
-DPAGE_SIZE=8192"
)
PROPERTIES COMPILE_FLAGS
"
${
ma_pagecache_common_cppflags
}
-DPAGE_SIZE=8192"
)
ADD_EXECUTABLE
(
ma_pagecache_single_64k
_t_big
${
ma_pagecache_single_src
}
)
ADD_EXECUTABLE
(
ma_pagecache_single_64k
-t
${
ma_pagecache_single_src
}
)
SET_TARGET_PROPERTIES
(
ma_pagecache_single_64k
_t_big
SET_TARGET_PROPERTIES
(
ma_pagecache_single_64k
-t
PROPERTIES COMPILE_FLAGS
"
${
ma_pagecache_common_cppflags
}
-DPAGE_SIZE=65536"
)
PROPERTIES COMPILE_FLAGS
"
${
ma_pagecache_common_cppflags
}
-DPAGE_SIZE=65536"
)
ADD_EXECUTABLE
(
ma_pagecache_consist_1k
_
t
${
ma_pagecache_consist_src
}
)
ADD_EXECUTABLE
(
ma_pagecache_consist_1k
-
t
${
ma_pagecache_consist_src
}
)
SET_TARGET_PROPERTIES
(
ma_pagecache_consist_1k
_
t
SET_TARGET_PROPERTIES
(
ma_pagecache_consist_1k
-
t
PROPERTIES COMPILE_FLAGS
"
${
ma_pagecache_common_cppflags
}
-DPAGE_SIZE=1024"
)
PROPERTIES COMPILE_FLAGS
"
${
ma_pagecache_common_cppflags
}
-DPAGE_SIZE=1024"
)
ADD_EXECUTABLE
(
ma_pagecache_consist_64k
_t_big
${
ma_pagecache_consist_src
}
)
ADD_EXECUTABLE
(
ma_pagecache_consist_64k
-t
${
ma_pagecache_consist_src
}
)
SET_TARGET_PROPERTIES
(
ma_pagecache_consist_64k
_t_big
SET_TARGET_PROPERTIES
(
ma_pagecache_consist_64k
-t
PROPERTIES COMPILE_FLAGS
"
${
ma_pagecache_common_cppflags
}
-DPAGE_SIZE=65536"
)
PROPERTIES COMPILE_FLAGS
"
${
ma_pagecache_common_cppflags
}
-DPAGE_SIZE=65536"
)
ADD_EXECUTABLE
(
ma_pagecache_consist_1kHC
_
t
ADD_EXECUTABLE
(
ma_pagecache_consist_1kHC
-
t
${
ma_pagecache_consist_src
}
)
${
ma_pagecache_consist_src
}
)
SET_TARGET_PROPERTIES
(
ma_pagecache_consist_1kHC
_
t
SET_TARGET_PROPERTIES
(
ma_pagecache_consist_1kHC
-
t
PROPERTIES COMPILE_FLAGS
"
${
ma_pagecache_common_cppflags
}
-DPAGE_SIZE=1024 -DTEST_HIGH_CONCURENCY"
)
PROPERTIES COMPILE_FLAGS
"
${
ma_pagecache_common_cppflags
}
-DPAGE_SIZE=1024 -DTEST_HIGH_CONCURENCY"
)
ADD_EXECUTABLE
(
ma_pagecache_consist_64kHC
_t_big
ADD_EXECUTABLE
(
ma_pagecache_consist_64kHC
-t
${
ma_pagecache_consist_src
}
)
${
ma_pagecache_consist_src
}
)
SET_TARGET_PROPERTIES
(
ma_pagecache_consist_64kHC
_t_big
SET_TARGET_PROPERTIES
(
ma_pagecache_consist_64kHC
-t
PROPERTIES COMPILE_FLAGS
"
${
ma_pagecache_common_cppflags
}
-DPAGE_SIZE=65536 -DTEST_HIGH_CONCURENCY"
)
PROPERTIES COMPILE_FLAGS
"
${
ma_pagecache_common_cppflags
}
-DPAGE_SIZE=65536 -DTEST_HIGH_CONCURENCY"
)
ADD_EXECUTABLE
(
ma_pagecache_consist_1kRD
_
t
${
ma_pagecache_consist_src
}
)
ADD_EXECUTABLE
(
ma_pagecache_consist_1kRD
-
t
${
ma_pagecache_consist_src
}
)
SET_TARGET_PROPERTIES
(
ma_pagecache_consist_1kRD
_
t
SET_TARGET_PROPERTIES
(
ma_pagecache_consist_1kRD
-
t
PROPERTIES COMPILE_FLAGS
"
${
ma_pagecache_common_cppflags
}
-DPAGE_SIZE=1024 -DTEST_READERS"
)
PROPERTIES COMPILE_FLAGS
"
${
ma_pagecache_common_cppflags
}
-DPAGE_SIZE=1024 -DTEST_READERS"
)
ADD_EXECUTABLE
(
ma_pagecache_consist_64kRD
_t_big
${
ma_pagecache_consist_src
}
)
ADD_EXECUTABLE
(
ma_pagecache_consist_64kRD
-t
${
ma_pagecache_consist_src
}
)
SET_TARGET_PROPERTIES
(
ma_pagecache_consist_64kRD
_t_big
SET_TARGET_PROPERTIES
(
ma_pagecache_consist_64kRD
-t
PROPERTIES COMPILE_FLAGS
"
${
ma_pagecache_common_cppflags
}
-DPAGE_SIZE=65536 -DTEST_READERS"
)
PROPERTIES COMPILE_FLAGS
"
${
ma_pagecache_common_cppflags
}
-DPAGE_SIZE=65536 -DTEST_READERS"
)
ADD_EXECUTABLE
(
ma_pagecache_consist_1kWR
_
t
${
ma_pagecache_consist_src
}
)
ADD_EXECUTABLE
(
ma_pagecache_consist_1kWR
-
t
${
ma_pagecache_consist_src
}
)
SET_TARGET_PROPERTIES
(
ma_pagecache_consist_1kWR
_
t
SET_TARGET_PROPERTIES
(
ma_pagecache_consist_1kWR
-
t
PROPERTIES COMPILE_FLAGS
"
${
ma_pagecache_common_cppflags
}
-DPAGE_SIZE=1024 -DTEST_WRITERS"
)
PROPERTIES COMPILE_FLAGS
"
${
ma_pagecache_common_cppflags
}
-DPAGE_SIZE=1024 -DTEST_WRITERS"
)
ADD_EXECUTABLE
(
ma_pagecache_consist_64kWR
_t_big
${
ma_pagecache_consist_src
}
)
ADD_EXECUTABLE
(
ma_pagecache_consist_64kWR
-t
${
ma_pagecache_consist_src
}
)
SET_TARGET_PROPERTIES
(
ma_pagecache_consist_64kWR
_t_big
SET_TARGET_PROPERTIES
(
ma_pagecache_consist_64kWR
-t
PROPERTIES COMPILE_FLAGS
"
${
ma_pagecache_common_cppflags
}
-DPAGE_SIZE=65536 -DTEST_WRITERS"
)
PROPERTIES COMPILE_FLAGS
"
${
ma_pagecache_common_cppflags
}
-DPAGE_SIZE=65536 -DTEST_WRITERS"
)
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