Exemple #1
0
    $success = false;
}
// write 10k messages to category foodoo (handled by prefix store)
print "test writing 10k messages to category foodoo\n";
stress_test('foodoo', 'client1', 10000, 10000, 20, 100, 1);
sleep(5);
$results = resultChecker('/tmp/scribetest_/foo', 'foo-', 'client1');
if ($results["count"] != 10000 || $results["out_of_order"] != 0) {
    $success = false;
}
// write 10k messages to category rock (handled by categories prefix store)
print "test writing 100k messages to category rock\n";
stress_test('rock', 'client1', 100, 10000, 20, 100, 1);
sleep(5);
$results = resultChecker('/tmp/scribetest_/rockpaper', 'rockpaper-', 'client1');
if ($results["count"] != 10000 || $results["out_of_order"] != 0) {
    $success = false;
}
// write 10k messages to category paper (handled by categories store)
print "test writing 10k messages to category paper\n";
stress_test('paper', 'client2', 1000, 10000, 20, 500, 1);
sleep(5);
$results = resultChecker('/tmp/scribetest_/rockpaper', 'rockpaper-', 'client2');
if ($results["count"] != 10000 || $results["out_of_order"] != 0) {
    $success = false;
}
if (!scribe_stop($GLOBALS['SCRIBE_CTRL'], $GLOBALS['SCRIBE_PORT'], $pid)) {
    print "ERROR: could not stop scribe\n";
    return false;
}
return $success;
$cmd = "ln -sf bidmap.1 bidmap";
echo "{$cmd}\n";
// symlink
system($cmd);
// start bidupdaer
$cmd = "../../_bin/scribe/test/bucketupdater/bidupdater -p 9999 -f ./bidmap > bidupdater.out 2>&1 & echo \$!";
echo "{$cmd}\n";
$pidUpdater = system($cmd);
echo "Starting scribe central server: 1463,scribe.conf.bucketupdater.central.\n";
// start scribe central server
$pidScribeCentral = scribe_start("bucketupdater.central", $GLOBALS['SCRIBE_BIN'], 1463, "scribe.conf.bucketupdater.central");
// test
$success1 = bucketupdater_test("server1/bucket001/content_current", "server2/bucket002/content_current", "server3/bucket002/content_current");
// change symlink
$cmd = "ln -sf bidmap.2 bidmap";
echo "{$cmd}\n";
system($cmd);
echo "sleep(15) to wait for bucket updater to take effect.\n";
sleep(15);
// test again
$success2 = bucketupdater_test("server2/bucket001/content_current", "server1/bucket002/content_current", "server1/bucket002/content_current");
// stop scribe server
scribe_stop($GLOBALS['SCRIBE_CTRL'], 1465, $pidScribe1);
scribe_stop($GLOBALS['SCRIBE_CTRL'], 1466, $pidScribe2);
scribe_stop($GLOBALS['SCRIBE_CTRL'], 1467, $pidScribe3);
scribe_stop($GLOBALS['SCRIBE_CTRL'], 1463, $pidScribeCentral);
// kill -9
$cmd = "kill -9 {$pidUpdater}\n";
echo "{$cmd}\n";
system($cmd);
return $success1 && $success2;