Skip to content

Add config rewrite#104

Merged
doyoubi merged 5 commits intoeleme:masterfrom
doyoubi:feature/ConfigRewrite
Feb 15, 2017
Merged

Add config rewrite#104
doyoubi merged 5 commits intoeleme:masterfrom
doyoubi:feature/ConfigRewrite

Conversation

@doyoubi
Copy link
Copy Markdown
Contributor

@doyoubi doyoubi commented Jan 11, 2017

In the PR #95 I explained why we need config set node:

  • When all of the 16 nodes kept in memory are moved out from the cluster at the same time, corvus can't find correct nodes automatically any more.
  • After several times of deleting cluster nodes, the node in config file may become outdated. Once restarted corvus can't find the correct nodes.

The first problem has been solved by #95, so we continue to address the second one by adding a new command config rewrite.

@doyoubi doyoubi force-pushed the feature/ConfigRewrite branch 2 times, most recently from 5a5ab99 to 9a85d4a Compare January 22, 2017 03:54
@doyoubi doyoubi force-pushed the feature/ConfigRewrite branch from 9a85d4a to f00791e Compare February 6, 2017 08:43
@doyoubi doyoubi force-pushed the feature/ConfigRewrite branch from f00791e to 5d9e2df Compare February 6, 2017 09:42
@doyoubi doyoubi force-pushed the feature/ConfigRewrite branch from 9559b5a to 6d12f07 Compare February 10, 2017 08:13
@doyoubi doyoubi changed the title [WIP] Add config rewrite Add config rewrite Feb 15, 2017
@doyoubi doyoubi merged commit 45ff698 into eleme:master Feb 15, 2017

bool config_option_changable(const char *option)
{
const char *CHANGABLE_OPTIONS[] = {"node", "loglevel", "slowlog-log-slower-than"};
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should put it in the doc.

}

// Caller should free the returned vector.
// Return an empty line array if fail to open or read old config file.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo here: read old config file => read empty config file

if (EOF == fputs(buf.data, fp)) {
goto end;
}
// Note that dict_set will save the key in its inner space
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

save the key pointer in its inner space

void *WRITTEN_TAG = (void*)1;
struct dict written_tags, options_map;
dict_init(&written_tags);
dict_init(&options_map);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dict_set will not overwrite the same key. It just add the key again with another value.

@doyoubi doyoubi mentioned this pull request May 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant