[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config rewrite #104

Merged
merged 5 commits into from
Feb 15, 2017
Merged

Add config rewrite #104

merged 5 commits into from
Feb 15, 2017

Conversation

doyoubi
Copy link
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 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
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
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
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
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