Skip to content

PoolCluster node remove method #1007

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

Closed
wants to merge 3 commits into from
Closed

PoolCluster node remove method #1007

wants to merge 3 commits into from

Conversation

mlshvdv
Copy link
Contributor

@mlshvdv mlshvdv commented Feb 21, 2015

Added poolCluster.remove() method, which helps to remove nodes from cluster:

// create
var poolCluster = mysql.createPoolCluster();

poolCluster.add(config); // anonymous group
poolCluster.add('MASTER', masterConfig);
poolCluster.add('SLAVE1', slave1Config);
poolCluster.add('SLAVE2', slave2Config);

// remove manually
poolCluster.remove('SLAVE2'); // By nodeId
poolCluster.remove('SLAVE*'); // By target group : SLAVE1-2

// event on manually removing (for each node)
poolCluster.on('removeManually', function (nodeId) {
  console.log('REMOVED MANUALLY NODE: ' + nodeId); // nodeId = SLAVE1
});

// event on auto removing (i.e. when connection was lost)
poolCluster.on('remove', function (nodeId) {
  console.log('REMOVED NODE : ' + nodeId); // nodeId = SLAVE1
});

@mlshvdv mlshvdv changed the title PoolCluster node remove config #1006 PoolCluster node remove config Feb 21, 2015
@mlshvdv mlshvdv changed the title PoolCluster node remove config PoolCluster node remove method Feb 21, 2015
@mlshvdv
Copy link
Contributor Author

mlshvdv commented Feb 23, 2015

Please check tests and merge PR asap. Thank you!

@dougwilson
Copy link
Member

Awesome, thank you!

@dougwilson dougwilson self-assigned this Feb 24, 2015
@jonathanrdelgado
Copy link

Awesome feature!

@mlshvdv
Copy link
Contributor Author

mlshvdv commented Mar 2, 2015

@dougwilson When do you plan to merge the PR? This feature is very important for the our project. We need to deploy source to a lot of servers ASAP. Thank you.

@dougwilson
Copy link
Member

Soon, mainly after I reviewed it and feel comfortable about it. I will have to maintain this code in the future and will have to field all bug reports about said code, so I don't want to move in haste. If you need it ASAP, just set your package.json to simply have

  "dependencies": {
    "mysql": "MalyshevDmitry/node-mysql#c671c648"
  }

@mlshvdv
Copy link
Contributor Author

mlshvdv commented Mar 2, 2015

@dougwilson Ok, thank you!

@dougwilson dougwilson added this to the 2.6 milestone Mar 8, 2015
@dougwilson dougwilson closed this in 7bacf3b Mar 8, 2015
seangarner pushed a commit to seangarner/node-mysql that referenced this pull request May 11, 2015
@mysqljs mysqljs locked and limited conversation to collaborators Jun 30, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging this pull request may close these issues.

3 participants