Bug #20260
closedA remote job runs multiple times on a single server that belongs to multiple Host Collections
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1465628
Description of problem:
When you run a remote job on a single host collection and it contains a system that belongs to multiple host collections, the job will run multiple times on that system.
How reproducible:
100%
Steps to Reproduce:
[root@sat62 ~]# hammer job-invocation create --job-template "Run Command - SSH Default" --inputs command='date +"%H:%M:%S.%N" >> /tmp/lala.txt' --search-query "host_collection = hostcol01"
Job invocation 13 created
[........................................................................................................................................] [100%]
8 task(s), 6 success, 2 fail
^^Note: 8 tasks created.
[root@sat62 ~]# hammer host-collection info --id 3
ID: 3
Name: hostcol01
Limit: None
Description:
Total Hosts: 4
^^ Note: hostcol01 has 4 hosts only.
[root@member-of-hostcol01 ~]# cat /tmp/lala.txt
18:26:55.103882174
18:26:55.104630745
18:26:55.273895571
^^ This specific member of hostcol01 belongs to 3 host collections. It ran this job 3 times.
[root@member-of-hostcol01 ~]# journalctl u sshd --since 18:20:55 Logs begin at Dom 2017-06-25 04:35:12 UTC, end at Ter 2017-06-27 18:45:30 UTC. --
-
Jun 27 18:26:54 member-of-hostcol01.example.com sshd2269: Accepted publickey for root from 172.18.0.1 port 45202 ssh2: RSA ee:a4:a8:67:65:b9:a3:
Jun 27 18:26:54 member-of-hostcol01.example.com sshd2271: Accepted publickey for root from 172.18.0.1 port 45204 ssh2: RSA ee:a4:a8:67:65:b9:a3:
Jun 27 18:26:54 member-of-hostcol01.example.com sshd2270: Accepted publickey for root from 172.18.0.1 port 45203 ssh2: RSA ee:a4:a8:67:65:b9:a3:
^^ All 3 visits to this host on the same second.
[root@other-member-of-hostcol01 ~]# cat /tmp/lala.txt
18:26:54.671381525
^^ Note, this host belongs to a single Host Collection. It ran the remote job only once.
Actual results:
It created 8 tasks
Expected results:
4 tasks and the job to run only once.