Skip to content
Browse files

issue 811: update mml if RangeServer address or IP changes

  • Loading branch information...
1 parent 1211449 commit 6c97fd2355fa0808a4ba9a1c3ab9dfed3bd4a317 @cruppstahl committed
View
2 src/cc/Hypertable/Master/Context.cc
@@ -66,7 +66,7 @@ bool Context::connect_server(RangeServerConnectionPtr &rsc, const String &hostna
comm->add_proxy(rsc->location(), hostname, public_addr);
HT_INFOF("Registered proxy %s", rsc->location().c_str());
- if (rsc->connect(hostname, local_addr, public_addr)) {
+ if (rsc->connect(hostname, local_addr, public_addr, test_mode)) {
conn_count++;
if (conn_count == 1)
notify = true;
View
10 src/cc/Hypertable/Master/RangeServerConnection.cc
@@ -52,8 +52,16 @@ void RangeServerConnection::set_mml_writer(MetaLog::WriterPtr &mml_writer) {
m_mml_writer = mml_writer;
}
-bool RangeServerConnection::connect(const String &hostname, InetAddr local_addr, InetAddr public_addr) {
+bool RangeServerConnection::connect(const String &hostname,
+ InetAddr local_addr, InetAddr public_addr, bool test_mode) {
ScopedLock lock(m_mutex);
+
+ // update the mml if the hostname or IP changed
+ if (hostname != m_hostname || public_addr != m_public_addr) {
+ if (!test_mode)
+ m_mml_writer->record_state(this);
+ }
+
m_hostname = hostname;
m_local_addr = local_addr;
m_public_addr = public_addr;
View
3 src/cc/Hypertable/Master/RangeServerConnection.h
@@ -76,7 +76,8 @@ namespace Hypertable {
friend class Context;
protected:
- bool connect(const String &hostname, InetAddr local_addr, InetAddr public_addr);
+ bool connect(const String &hostname, InetAddr local_addr,
+ InetAddr public_addr, bool test_mode = false);
bool disconnect();
private:

0 comments on commit 6c97fd2

Please sign in to comment.
Something went wrong with that request. Please try again.