saltstack/salt — pull request #13285 by jacksontj (2014-06-06 05:58:23+00:00)
Title: More granular master job targeting

Please DO NOT MERGE IMMEDIATELY.

Salt targeting is done using the zmq pub/sub mechanism. No filtering is done so all requests go to all minions. This is an attempt to make the requests more target-able. ZeroMQ supports filters on these sockets which are processed publisher side. So the thought is to set it to the minion id and a shared "broadcast" one. Only requests of tgt_type == list will use this. The thought is if we like this we can use other data (mine etc) to determine a more specific target on the master (such as a list) from a glob match etc.

This is more or less backwards compatible, during my testing it still works but the old minion will throw an exception like:

[CRITICAL] An exception occurred while polling the minion
Traceback (most recent call last):
File "/home/thjackso/src/salt/salt/minion.py", line 1324, in tune_in
payload = self.serial.loads(self.socket.recv(zmq.NOBLOCK))
File "/home/thjackso/src/salt/salt/payload.py", line 95, in loads
return msgpack.loads(msg, use_list=True)
File "_unpacker.pyx", line 114, in msgpack._unpacker.unpackb (msgpack/_unpacker.cpp:114)
ExtraData: unpack(b) recieved extra data.

The new minion (in this PR) will work with both configurations-- although once a minion has enabled targeting it will no longer receive old-style messages.

This is another attempt of #10374.
And exactly the same as #13154