Commit 3e90f0d8 authored by unknown's avatar unknown

Added variable to control log directory syncs.

Part of postreview fixes added.


mysql-test/r/maria.result:
  Added variable to control log directory syncs.
storage/maria/ha_maria.cc:
  Added variable to control log directory syncs.
storage/maria/ma_loghandler.h:
  Added variable to control log directory syncs.
storage/maria/ma_loghandler_lsn.h:
  postreview fix
storage/maria/unittest/Makefile.am:
  New file with logrecord descriptors for tests.
storage/maria/unittest/ma_test_loghandler-t.c:
  New file with logrecord descriptors for tests.
storage/maria/unittest/ma_test_loghandler_first_lsn-t.c:
  New file with logrecord descriptors for tests.
storage/maria/unittest/ma_test_loghandler_max_lsn-t.c:
  New file with logrecord descriptors for tests.
storage/maria/unittest/ma_test_loghandler_multigroup-t.c:
  New file with logrecord descriptors for tests.
storage/maria/unittest/ma_test_loghandler_multithread-t.c:
  New file with logrecord descriptors for tests.
storage/maria/unittest/ma_test_loghandler_noflush-t.c:
  New file with logrecord descriptors for tests.
storage/maria/unittest/ma_test_loghandler_pagecache-t.c:
  New file with logrecord descriptors for tests.
storage/maria/unittest/ma_test_loghandler_purge-t.c:
  New file with logrecord descriptors for tests.
storage/maria/unittest/ma_loghandler_examples.c:
  New BitKeeper file ``storage/maria/unittest/ma_loghandler_examples.c''
parent 1e865f0a
......@@ -2055,6 +2055,7 @@ maria_pagecache_division_limit 100
maria_repair_threads 1
maria_sort_buffer_size 8388608
maria_stats_method nulls_unequal
maria_sync_log_dir NEWFILE
show status like 'maria%';
Variable_name Value
Maria_pagecache_blocks_not_flushed #
......
......@@ -81,6 +81,17 @@ TYPELIB maria_stats_method_typelib=
maria_stats_method_names, NULL
};
const char *maria_sync_log_dir_names[]=
{
"NEVER", "NEWFILE", "ALWAYS", NullS
};
TYPELIB maria_sync_log_dir_typelib=
{
array_elements(maria_sync_log_dir_names) - 1, "",
maria_sync_log_dir_names, NULL
};
/** @brief Interval between background checkpoints in seconds */
static ulong checkpoint_interval;
static void update_checkpoint_interval(MYSQL_THD thd,
......@@ -140,6 +151,12 @@ static MYSQL_THDVAR_ENUM(stats_method, PLUGIN_VAR_RQCMDARG,
"NULLs. Possible values of name are \"nulls_unequal\", \"nulls_equal\", "
"and \"nulls_ignored\".", 0, 0, 0, &maria_stats_method_typelib);
static MYSQL_SYSVAR_ENUM(sync_log_dir, sync_log_dir, PLUGIN_VAR_RQCMDARG,
"Controls syncing directory after log file growth and new file "
"creation. Possible values of are \"never\", \"newfile\" and "
"\"always\")", NULL, NULL, TRANSLOG_SYNC_DIR_NEWFILE,
&maria_sync_log_dir_typelib);
/*****************************************************************************
** MARIA tables
*****************************************************************************/
......@@ -2512,6 +2529,7 @@ static struct st_mysql_sys_var* system_variables[]= {
MYSQL_SYSVAR(repair_threads),
MYSQL_SYSVAR(sort_buffer_size),
MYSQL_SYSVAR(stats_method),
MYSQL_SYSVAR(sync_log_dir),
NULL
};
......
This diff is collapsed.
......@@ -253,8 +253,6 @@ C_MODE_START
#define LOGREC_FIXED_RECORD_2LSN_EXAMPLE 5
#define LOGREC_VARIABLE_RECORD_2LSN_EXAMPLE 6
extern void example_loghandler_init();
extern my_bool translog_init(const char *directory, uint32 log_file_max_size,
uint32 server_version, uint32 server_id,
PAGECACHE *pagecache, uint flags);
......@@ -402,5 +400,13 @@ typedef struct st_log_record_type_descriptor
extern LOG_DESC log_record_type_descriptor[LOGREC_NUMBER_OF_TYPES];
#endif
typedef enum
{
TRANSLOG_SYNC_DIR_NEVER,
TRANSLOG_SYNC_DIR_NEWFILE,
TRANSLOG_SYNC_DIR_ALWAYS
} enum_maria_sync_log_dir;
extern ulong sync_log_dir;
C_MODE_END
#endif
......@@ -32,7 +32,12 @@ typedef int64 TRANSLOG_ADDRESS;
*/
#define cmp_translog_addr(A1,A2) ((A1) - (A2))
/* LSN type (address of certain log record chank */
/*
TRANSLOG_ADDRESS is just address of some byte in the log (usually some
chunk)
LSN used where address of some record in the log needed (not just any
address)
*/
typedef TRANSLOG_ADDRESS LSN;
/* Gets file number part of a LSN/log address */
......
......@@ -48,16 +48,16 @@ noinst_PROGRAMS = ma_control_file-t trnman-t lockman2-t \
ma_test_loghandler_max_lsn-t \
ma_test_loghandler_purge-t
ma_test_loghandler_t_SOURCES = ma_test_loghandler-t.c ma_maria_log_cleanup.c
ma_test_loghandler_multigroup_t_SOURCES = ma_test_loghandler_multigroup-t.c ma_maria_log_cleanup.c
ma_test_loghandler_multithread_t_SOURCES = ma_test_loghandler_multithread-t.c ma_maria_log_cleanup.c
ma_test_loghandler_pagecache_t_SOURCES = ma_test_loghandler_pagecache-t.c ma_maria_log_cleanup.c
ma_test_loghandler_long_t_big_SOURCES = ma_test_loghandler-t.c ma_maria_log_cleanup.c
ma_test_loghandler_t_SOURCES = ma_test_loghandler-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c
ma_test_loghandler_multigroup_t_SOURCES = ma_test_loghandler_multigroup-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c
ma_test_loghandler_multithread_t_SOURCES = ma_test_loghandler_multithread-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c
ma_test_loghandler_pagecache_t_SOURCES = ma_test_loghandler_pagecache-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c
ma_test_loghandler_long_t_big_SOURCES = ma_test_loghandler-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c
ma_test_loghandler_long_t_big_CPPFLAGS = -DLONG_LOG_TEST
ma_test_loghandler_noflush_t_SOURCES = ma_test_loghandler_noflush-t.c ma_maria_log_cleanup.c
ma_test_loghandler_first_lsn_t_SOURCES = ma_test_loghandler_first_lsn-t.c ma_maria_log_cleanup.c
ma_test_loghandler_max_lsn_t_SOURCES = ma_test_loghandler_max_lsn-t.c ma_maria_log_cleanup.c
ma_test_loghandler_purge_t_SOURCES = ma_test_loghandler_purge-t.c ma_maria_log_cleanup.c
ma_test_loghandler_noflush_t_SOURCES = ma_test_loghandler_noflush-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c
ma_test_loghandler_first_lsn_t_SOURCES = ma_test_loghandler_first_lsn-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c
ma_test_loghandler_max_lsn_t_SOURCES = ma_test_loghandler_max_lsn-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c
ma_test_loghandler_purge_t_SOURCES = ma_test_loghandler_purge-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c
ma_pagecache_single_src = ma_pagecache_single.c test_file.c test_file.h
ma_pagecache_consist_src = ma_pagecache_consist.c test_file.c test_file.h
......
/* TODO: copyright */
#include "../maria_def.h"
static LOG_DESC INIT_LOGREC_FIXED_RECORD_0LSN_EXAMPLE=
{LOGRECTYPE_FIXEDLENGTH, 6, 6, NULL, NULL, NULL, 0,
"fixed0example", LOGREC_NOT_LAST_IN_GROUP, NULL, NULL};
static LOG_DESC INIT_LOGREC_VARIABLE_RECORD_0LSN_EXAMPLE=
{LOGRECTYPE_VARIABLE_LENGTH, 0, 9, NULL, NULL, NULL, 0,
"variable0example", LOGREC_NOT_LAST_IN_GROUP, NULL, NULL};
static LOG_DESC INIT_LOGREC_FIXED_RECORD_1LSN_EXAMPLE=
{LOGRECTYPE_PSEUDOFIXEDLENGTH, 7, 7, NULL, NULL, NULL, 1,
"fixed1example", LOGREC_NOT_LAST_IN_GROUP, NULL, NULL};
static LOG_DESC INIT_LOGREC_VARIABLE_RECORD_1LSN_EXAMPLE=
{LOGRECTYPE_VARIABLE_LENGTH, 0, 12, NULL, NULL, NULL, 1,
"variable1example", LOGREC_NOT_LAST_IN_GROUP, NULL, NULL};
static LOG_DESC INIT_LOGREC_FIXED_RECORD_2LSN_EXAMPLE=
{LOGRECTYPE_PSEUDOFIXEDLENGTH, 23, 23, NULL, NULL, NULL, 2,
"fixed2example", LOGREC_NOT_LAST_IN_GROUP, NULL, NULL};
static LOG_DESC INIT_LOGREC_VARIABLE_RECORD_2LSN_EXAMPLE=
{LOGRECTYPE_VARIABLE_LENGTH, 0, 19, NULL, NULL, NULL, 2,
"variable2example", LOGREC_NOT_LAST_IN_GROUP, NULL, NULL};
void example_loghandler_init()
{
int i;
log_record_type_descriptor[LOGREC_FIXED_RECORD_0LSN_EXAMPLE]=
INIT_LOGREC_FIXED_RECORD_0LSN_EXAMPLE;
log_record_type_descriptor[LOGREC_VARIABLE_RECORD_0LSN_EXAMPLE]=
INIT_LOGREC_VARIABLE_RECORD_0LSN_EXAMPLE;
log_record_type_descriptor[LOGREC_FIXED_RECORD_1LSN_EXAMPLE]=
INIT_LOGREC_FIXED_RECORD_1LSN_EXAMPLE;
log_record_type_descriptor[LOGREC_VARIABLE_RECORD_1LSN_EXAMPLE]=
INIT_LOGREC_VARIABLE_RECORD_1LSN_EXAMPLE;
log_record_type_descriptor[LOGREC_FIXED_RECORD_2LSN_EXAMPLE]=
INIT_LOGREC_FIXED_RECORD_2LSN_EXAMPLE;
log_record_type_descriptor[LOGREC_VARIABLE_RECORD_2LSN_EXAMPLE]=
INIT_LOGREC_VARIABLE_RECORD_2LSN_EXAMPLE;
for (i= LOGREC_VARIABLE_RECORD_2LSN_EXAMPLE + 1;
i < LOGREC_NUMBER_OF_TYPES;
i++)
log_record_type_descriptor[i].class= LOGRECTYPE_NOT_ALLOWED;
}
......@@ -5,6 +5,7 @@
#include "../trnman.h"
extern my_bool maria_log_remove();
extern void example_loghandler_init();
#ifndef DBUG_OFF
static const char *default_dbug_option;
......
......@@ -5,6 +5,7 @@
#include "../trnman.h"
extern my_bool maria_log_remove();
extern void example_loghandler_init();
#ifndef DBUG_OFF
static const char *default_dbug_option;
......
......@@ -5,6 +5,7 @@
#include "../trnman.h"
extern my_bool maria_log_remove();
extern void example_loghandler_init();
#ifndef DBUG_OFF
static const char *default_dbug_option;
......
......@@ -5,6 +5,7 @@
#include "../trnman.h"
extern my_bool maria_log_remove();
extern void example_loghandler_init();
#ifndef DBUG_OFF
static const char *default_dbug_option;
......
......@@ -5,6 +5,7 @@
#include "../trnman.h"
extern my_bool maria_log_remove();
extern void example_loghandler_init();
#ifndef DBUG_OFF
static const char *default_dbug_option;
......
......@@ -5,6 +5,7 @@
#include "../trnman.h"
extern my_bool maria_log_remove();
extern void example_loghandler_init();
#ifndef DBUG_OFF
static const char *default_dbug_option;
......
......@@ -5,6 +5,7 @@
#include "../trnman.h"
extern my_bool maria_log_remove();
extern void example_loghandler_init();
#ifndef DBUG_OFF
static const char *default_dbug_option;
......
......@@ -5,6 +5,7 @@
#include "../trnman.h"
extern my_bool maria_log_remove();
extern void example_loghandler_init();
#ifndef DBUG_OFF
static const char *default_dbug_option;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment