Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
5b24915
[Release] 1.1.1
Sep 1, 2014
6e0c2ea
Merge pull request #68 from gree/release-1.1
Sep 30, 2014
e015fb8
Fix zookeeper_lock::_assure_session_connected()
Nov 6, 2014
f3ab7c0
Fix op_set binary parser to enable behavior_cas flag
Nov 12, 2014
85e2dd1
Replication over cluster
Nov 13, 2014
d973d91
Merge pull request #82 from ikehara/fix_assure_session_connected
Nov 13, 2014
db38fda
Merge pull request #47 from m-yoshimo/cluster-replication-concurrency
ikehara Nov 13, 2014
3a886d8
Fix failure of test_handler_cluster_replication
Nov 14, 2014
986a3af
Merge pull request #86 from m-yoshimo/develop
ikehara Nov 14, 2014
61f7e4d
Merge branch 'master' into develop
yuji-kamiya-g Nov 14, 2014
24d1da4
[2014/11/14] 1.2.0 release
yuji-kamiya-g Nov 14, 2014
c9eafb8
Fix to build with clang
Nov 20, 2014
a8131e2
Fix connection_iostream::writeline return value
Nov 20, 2014
0c95652
Add bwlimit to op_dump_key
Nov 20, 2014
681a318
Refactoring around bwlimitter
Nov 21, 2014
20e4eb3
Merge pull request #87 from yayugu/feature/key_dump_bwlimit
Dec 2, 2014
c508d6a
Introduce a rwlock for write operations to avoid taking lots of read …
Oct 2, 2014
281863a
add copyright messages in each file
y-kamiya Dec 7, 2014
15542e5
Merge pull request #88 from ikehara/wholelock_for_dump
ikehara Dec 16, 2014
de6dfc5
Merge pull request #85 from ikehara/fix_binary_cas_behavior
ikehara Dec 16, 2014
b151af8
Add circle.yml and Dockerfile to test flare on circle-ci
Nov 10, 2014
08d4ab9
Only build master and coverity_scan branches on travis-ci
Dec 16, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,7 @@ script:
- make check && sudo make install
- flare-tests

branches:
only:
- master
- coverity_scan
18 changes: 18 additions & 0 deletions COPYRIGHT
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Flare
--------------
Copyright (C) 2008-2014 GREE, Inc.

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

31 changes: 31 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM ubuntu:14.04
RUN apt-get -y update
RUN apt-get -y --force-yes install cutter-testing-framework
RUN apt-get -y --force-yes install \
autoconf \
automake \
libtool \
make \
gcc \
g++ \
libboost-all-dev \
zlib1g-dev \
libncursesw5 \
git \
libhashkit-dev \
libtokyocabinet-dev \
libkyotocabinet-dev \
uuid-dev \
libsqlite3-dev \
libncurses5-dev \
libcurl4-openssl-dev \
devscripts \
git-buildpackage && \
apt-get clean

ADD . /tmp/flare
RUN cd /tmp/flare && ./autogen.sh && ./configure && make && make install
RUN cd /tmp/flare/test && bash ./run-tests.sh

CMD ["/usr/local/bin/flared", "-f", "/etc/flared.conf"]

38 changes: 38 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,41 @@
* [2014/11/14] 1.2.0 release

* feature updates
- Added storage access time watching feature
- Replication over cluster

* bug fixes
- Avoid to close the already closed socket.
- Fix bwlimit when creating new partition
- Fix initial value of epoll socket
- Fix pthread_cond_wait() in zookeeper_lock::_assure_session_connected()
- Fix resource leak of server socket
- Fix some initialization
- Fix the race condition in thread class
- Fix zookeeper_lock::_assure_session_connected()
- Fixed socket condition add_epoll_socket and add_kqueue_socket
- Modified include guards to fit them to the C++ standard naming convention.
- Skip proxy when destination node is down

* others
- Support TravisCI

* [2014/09/01] 1.1.1 release

* bug fixes
- Avoid to close the already closed socket
- Skip proxy request when destination node is down
- Fix the resource leaks of socket in server
- Fix some compile warnings
- Fix some race conditions in thread.cc
- Check dynamic_cast result
- Fix pthread_cond_wait() in zookeeper_lock::_assure_session_connected()
- Add initialization of cluster#node
- Remove some deadcode
- Add null check before the code with the potential null access
- Exit when IO-buffer is unsafe
- Fix memory leak of proxy in op_parser_text

* [2014/05/14] 1.1.0 release

* feature updates
Expand Down
13 changes: 13 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
machine:
timezone: Asia/Tokyo
services:
- docker

dependencies:
override:
- docker info
- docker build -t gree/flare .

test:
override:
- docker run -d -p 12121:12121 gree/flare
3 changes: 2 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.59)
AC_INIT(flare, 1.1.0)
AC_INIT(flare, 1.2.0)
AC_CONFIG_SRCDIR(src/flared/flared.cc)
AM_INIT_AUTOMAKE
AC_CONFIG_HEADERS(src/config.h)
Expand Down Expand Up @@ -163,6 +163,7 @@ fi
# And others...

AC_CHECK_FUNC(clock_gettime,[AC_DEFINE([HAVE_CLOCK_GETTIME], [], [have clock_gettime or not])])
AC_DEFINE([__STDC_FORMAT_MACROS], [1], [enable stdc format macros])

# Debug options

Expand Down
12 changes: 12 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
flare (1.2.0-1) unstable; urgency=low

* 1.2.0

-- Yuji Kamiya <yuji.kamiya@gree.net> Fri, 14 Nov 2014 02:25:44 +0000

flare (1.1.1-1) unstable; urgency=low

* 1.1.1

-- Masanori Yoshimoto <masanori.yoshimoto@gree.net> Fri, 29 Aug 2014 14:02:50 +0900

flare (1.1.0-1) unstable; urgency=low

* 1.1.0
Expand Down
53 changes: 53 additions & 0 deletions src/flared/flared.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
* Flare
* --------------
* Copyright (C) 2008-2014 GREE, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/**
* flared.cc
*
Expand Down Expand Up @@ -161,13 +180,16 @@ int flared::startup(int argc, char **argv) {

this->_thread_pool = new thread_pool(ini_option_object().get_thread_pool_size(), ini_option_object().get_stack_size());

this->_cluster_replication = shared_cluster_replication(new cluster_replication(this->_thread_pool));

this->_cluster = new cluster(this->_thread_pool, ini_option_object().get_server_name(), ini_option_object().get_server_port());
this->_cluster->set_proxy_concurrency(ini_option_object().get_proxy_concurrency());
this->_cluster->set_reconstruction_interval(ini_option_object().get_reconstruction_interval());
this->_cluster->set_reconstruction_bwlimit(ini_option_object().get_reconstruction_bwlimit());
this->_cluster->set_replication_type(ini_option_object().get_replication_type());
this->_cluster->set_max_total_thread_queue(ini_option_object().get_max_total_thread_queue());
this->_cluster->set_noreply_window_limit(ini_option_object().get_noreply_window_limit());
this->_cluster->add_proxy_event_listener(this->_cluster_replication);
if (this->_cluster->startup_node(ini_option_object().get_index_servers(),
ini_option_object().get_proxy_prior_netmask()) < 0) {
return -1;
Expand Down Expand Up @@ -245,6 +267,17 @@ int flared::startup(int argc, char **argv) {
}
#endif

// cluster replication
this->_cluster_replication->set_sync(ini_option_object().get_cluster_replication_sync());
if (ini_option_object().is_cluster_replication()) {
string n = ini_option_object().get_cluster_replication_server_name();
int p = ini_option_object().get_cluster_replication_server_port();
int c = ini_option_object().get_cluster_replication_concurrency();
if (this->_cluster_replication->start(n, p, c, this->_storage, this->_cluster) < 0) {
return -1;
}
}

if (this->_set_pid() < 0) {
return -1;
}
Expand Down Expand Up @@ -358,6 +391,26 @@ int flared::reload() {
time_watcher_object->start(ini_option_object().get_time_watcher_polling_interval_msec());
}

// cluster replication
this->_cluster_replication->set_sync(ini_option_object().get_cluster_replication_sync());

if (ini_option_object().is_cluster_replication()) {
string cl_repl_server_name = ini_option_object().get_cluster_replication_server_name();
int cl_repl_server_port = ini_option_object().get_cluster_replication_server_port();
int cl_repl_concurrency = ini_option_object().get_cluster_replication_concurrency();

if (this->_cluster_replication->is_started()
&& (cl_repl_server_name != this->_cluster_replication->get_server_name()
|| cl_repl_server_port != this->_cluster_replication->get_server_port())) {
this->_cluster_replication->stop();
}

this->_cluster_replication->start(cl_repl_server_name, cl_repl_server_port, cl_repl_concurrency,
this->_storage, this->_cluster);
} else {
this->_cluster_replication->stop();
}

log_notice("process successfully reloaded", 0);

return 0;
Expand Down
25 changes: 25 additions & 0 deletions src/flared/flared.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
* Flare
* --------------
* Copyright (C) 2008-2014 GREE, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/**
* flared.h
*
Expand All @@ -9,6 +28,7 @@
#define FLARED_H

#include "app.h"
#include "cluster_replication.h"
#include "ini_option.h"
#include "stats_node.h"
#include "status_node.h"
Expand All @@ -17,6 +37,10 @@
namespace gree {
namespace flare {

using boost::shared_ptr;

typedef shared_ptr<cluster_replication> shared_cluster_replication;

/**
* flared application class
*/
Expand All @@ -31,6 +55,7 @@ class flared :
#ifdef ENABLE_MYSQL_REPLICATION
server* _mysql_replication_server;
#endif
shared_cluster_replication _cluster_replication;

public:
flared();
Expand Down
19 changes: 19 additions & 0 deletions src/flared/handler_alarm.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
* Flare
* --------------
* Copyright (C) 2008-2014 GREE, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/**
* handler_alarm.cc
*
Expand Down
19 changes: 19 additions & 0 deletions src/flared/handler_alarm.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
* Flare
* --------------
* Copyright (C) 2008-2014 GREE, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/**
* handler_alarm.h
*
Expand Down
19 changes: 19 additions & 0 deletions src/flared/handler_mysql_replication.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
* Flare
* --------------
* Copyright (C) 2008-2014 GREE, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/**
* handler_mysql_replication.cc
*
Expand Down
19 changes: 19 additions & 0 deletions src/flared/handler_mysql_replication.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
* Flare
* --------------
* Copyright (C) 2008-2014 GREE, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/**
* handler_mysql_replication.h
*
Expand Down
19 changes: 19 additions & 0 deletions src/flared/handler_request.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
* Flare
* --------------
* Copyright (C) 2008-2014 GREE, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/**
* handler_request.cc
*
Expand Down
Loading