Uncrustify maxscale
See script directory for method. The script to run in the top level MaxScale directory is called maxscale-uncrustify.sh, which uses another script, list-src, from the same directory (so you need to set your PATH). The uncrustify version was 0.66.
This commit is contained in:
57
maxscale-system-test/mysqlmon_failover_stress.cpp
Executable file → Normal file
57
maxscale-system-test/mysqlmon_failover_stress.cpp
Executable file → Normal file
@ -35,16 +35,16 @@ const time_t FAILOVER_DURATION = 5;
|
||||
const time_t TEST_DURATION = 90;
|
||||
|
||||
#define CMESSAGE(msg) \
|
||||
do {\
|
||||
stringstream ss;\
|
||||
ss << "client(" << m_id << ") : " << msg << "\n";\
|
||||
cout << ss.str() << flush;\
|
||||
do { \
|
||||
stringstream ss; \
|
||||
ss << "client(" << m_id << ") : " << msg << "\n"; \
|
||||
cout << ss.str() << flush; \
|
||||
} while (false)
|
||||
|
||||
#if !defined(NDEBUG)
|
||||
#if !defined (NDEBUG)
|
||||
|
||||
#define ss_dassert(x) do { if (!(x)) { fprintf(stderr, "Assertion failed: %s\n", #x); abort(); } } while(false)
|
||||
#define ss_debug(x) x
|
||||
#define ss_dassert(x) do {if (!(x)) {fprintf(stderr, "Assertion failed: %s\n", #x); abort();}} while (false)
|
||||
#define ss_debug(x) x
|
||||
|
||||
#else
|
||||
|
||||
@ -63,7 +63,7 @@ public:
|
||||
enum
|
||||
{
|
||||
DEFAULT_N_CLIENTS = 4,
|
||||
DEFAULT_N_ROWS = 100
|
||||
DEFAULT_N_ROWS = 100
|
||||
};
|
||||
|
||||
static void init(TestConnections& test, size_t nClients, size_t nRows)
|
||||
@ -82,12 +82,20 @@ public:
|
||||
}
|
||||
|
||||
static void start(bool verbose,
|
||||
const char* zHost, int port, const char* zUser, const char* zPassword)
|
||||
const char* zHost,
|
||||
int port,
|
||||
const char* zUser,
|
||||
const char* zPassword)
|
||||
{
|
||||
for (size_t i = 0; i < s_nClients; ++i)
|
||||
{
|
||||
s_threads.push_back(std::thread(&Client::thread_main,
|
||||
i, verbose, zHost, port, zUser, zPassword));
|
||||
i,
|
||||
verbose,
|
||||
zHost,
|
||||
port,
|
||||
zUser,
|
||||
zPassword));
|
||||
}
|
||||
}
|
||||
|
||||
@ -258,7 +266,6 @@ private:
|
||||
|
||||
while (!s_shutdown && run(pMysql))
|
||||
{
|
||||
;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -286,8 +293,12 @@ private:
|
||||
while (!s_shutdown);
|
||||
}
|
||||
|
||||
static void thread_main(int i, bool verbose,
|
||||
const char* zHost, int port, const char* zUser, const char* zPassword)
|
||||
static void thread_main(int i,
|
||||
bool verbose,
|
||||
const char* zHost,
|
||||
int port,
|
||||
const char* zUser,
|
||||
const char* zPassword)
|
||||
{
|
||||
if (mysql_thread_init() == 0)
|
||||
{
|
||||
@ -362,10 +373,10 @@ private:
|
||||
INITSTATE_SIZE = 32
|
||||
};
|
||||
|
||||
size_t m_id;
|
||||
bool m_verbose;
|
||||
size_t m_value;
|
||||
mutable std::mt19937 m_rand_gen;
|
||||
size_t m_id;
|
||||
bool m_verbose;
|
||||
size_t m_value;
|
||||
mutable std::mt19937 m_rand_gen;
|
||||
mutable std::uniform_real_distribution<double> m_rand_dist;
|
||||
|
||||
static size_t s_nClients;
|
||||
@ -379,7 +390,6 @@ size_t Client::s_nClients;
|
||||
size_t Client::s_nRows;
|
||||
bool Client::s_shutdown;
|
||||
std::vector<std::thread> Client::s_threads;
|
||||
|
||||
}
|
||||
|
||||
namespace
|
||||
@ -436,11 +446,11 @@ bool check_server_status(TestConnections& test, int id)
|
||||
char result[1024];
|
||||
if (find_field(pConn, "SHOW SLAVE STATUS", "Last_IO_Error", result) == 0)
|
||||
{
|
||||
const char needle[] =
|
||||
", which is not in the master's binlog. "
|
||||
"Since the master's binlog contains GTIDs with higher sequence numbers, "
|
||||
"it probably means that the slave has diverged due to executing extra "
|
||||
"erroneous transactions";
|
||||
const char needle[]
|
||||
= ", which is not in the master's binlog. "
|
||||
"Since the master's binlog contains GTIDs with higher sequence numbers, "
|
||||
"it probably means that the slave has diverged due to executing extra "
|
||||
"erroneous transactions";
|
||||
|
||||
if (strstr(result, needle))
|
||||
{
|
||||
@ -560,7 +570,6 @@ void run(TestConnections& test)
|
||||
check_server_statuses(test);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
|
||||
Reference in New Issue
Block a user