1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Add semi-sync support for Windows

CMakeLists.txt:
  Add plugin/semisync subdirectory
mysql-test/mysql-test-run.pl:
  Check for semisync dll for Windows
mysql-test/suite/rpl/r/rpl_semi_sync.result:
  Update result file
mysql-test/suite/rpl/t/rpl_semi_sync.test:
  Test semi-sync on Windows
plugin/semisync/semisync_master.cc:
  Define gettimeofday for Windows
This commit is contained in:
He Zhenxing
2009-10-23 12:56:30 +08:00
parent d8dee8cb32
commit e9acb9f021
6 changed files with 65 additions and 26 deletions

View File

@ -34,3 +34,5 @@ libsemisync_slave_la_LDFLAGS = -module
libsemisync_slave_la_CXXFLAGS= $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
libsemisync_slave_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
libsemisync_slave_la_SOURCES = semisync.cc semisync_slave.cc semisync_slave_plugin.cc
EXTRA_DIST= CMakeLists.txt plug.in

View File

@ -45,6 +45,18 @@ char rpl_semi_sync_master_wait_no_slave = 1;
static int getWaitTime(const struct timeval& start_tv);
#ifdef __WIN__
static int gettimeofday(struct timeval *tv, void *tz)
{
unsigned int ticks;
ticks= GetTickCount();
tv->tv_usec= ticks*1000;
tv->tv_sec= ticks/1000;
return 0;
}
#endif /* __WIN__ */
/*******************************************************************************
*
* <ActiveTranx> class : manage all active transaction nodes
@ -728,6 +740,11 @@ int ReplSemiSyncMaster::commitTrx(const char* trx_wait_binlog_name,
int diff_usecs = start_tv.tv_usec + wait_timeout_ * TIME_THOUSAND;
/* Calcuate the waiting period. */
#ifdef __WIN__
abstime.tv.i64 = (__int64)start_tv.tv_sec * TIME_MILLION * 10;
abstime.tv.i64 += (__int64)diff_usecs * 10;
abstime.max_timeout_msec= (long)wait_timeout_;
#else
abstime.tv_sec = start_tv.tv_sec;
if (diff_usecs < TIME_MILLION)
{
@ -742,6 +759,7 @@ int ReplSemiSyncMaster::commitTrx(const char* trx_wait_binlog_name,
}
abstime.tv_nsec = diff_usecs * TIME_THOUSAND;
}
#endif /* __WIN__ */
/* In semi-synchronous replication, we wait until the binlog-dump
* thread has received the reply on the relevant binlog segment from the