{"action":"created","issue":{"url":"https://api.github.com/repos/operator-framework/operator-sdk/issues/1978","repository_url":"https://api.github.com/repos/operator-framework/operator-sdk","labels_url":"https://api.github.com/repos/operator-framework/operator-sdk/issues/1978/labels{/name}","comments_url":"https://api.github.com/repos/operator-framework/operator-sdk/issues/1978/comments","events_url":"https://api.github.com/repos/operator-framework/operator-sdk/issues/1978/events","html_url":"https://github.com/operator-framework/operator-sdk/issues/1978","id":499067195,"node_id":"MDU6SXNzdWU0OTkwNjcxOTU=","number":1978,"title":"When reconcilePeriod is set, Ansible operator should only run playbook for CRs that have changed","user":{"login":"rammohanc","id":31996462,"node_id":"MDQ6VXNlcjMxOTk2NDYy","avatar_url":"https://avatars0.githubusercontent.com/u/31996462?v=4","gravatar_id":"","url":"https://api.github.com/users/rammohanc","html_url":"https://github.com/rammohanc","followers_url":"https://api.github.com/users/rammohanc/followers","following_url":"https://api.github.com/users/rammohanc/following{/other_user}","gists_url":"https://api.github.com/users/rammohanc/gists{/gist_id}","starred_url":"https://api.github.com/users/rammohanc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rammohanc/subscriptions","organizations_url":"https://api.github.com/users/rammohanc/orgs","repos_url":"https://api.github.com/users/rammohanc/repos","events_url":"https://api.github.com/users/rammohanc/events{/privacy}","received_events_url":"https://api.github.com/users/rammohanc/received_events","type":"User","site_admin":false},"labels":[{"id":1070453248,"node_id":"MDU6TGFiZWwxMDcwNDUzMjQ4","url":"https://api.github.com/repos/operator-framework/operator-sdk/labels/ansible-operator","name":"ansible-operator","color":"c2e0c6","default":false},{"id":830266067,"node_id":"MDU6TGFiZWw4MzAyNjYwNjc=","url":"https://api.github.com/repos/operator-framework/operator-sdk/labels/kind/feature","name":"kind/feature","color":"c7def8","default":false},{"id":955686085,"node_id":"MDU6TGFiZWw5NTU2ODYwODU=","url":"https://api.github.com/repos/operator-framework/operator-sdk/labels/needs%20discussion","name":"needs discussion","color":"078c6a","default":false},{"id":830266071,"node_id":"MDU6TGFiZWw4MzAyNjYwNzE=","url":"https://api.github.com/repos/operator-framework/operator-sdk/labels/triage/support","name":"triage/support","color":"d455d0","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2019-09-26T19:15:20Z","updated_at":"2019-10-01T17:00:28Z","closed_at":null,"author_association":"NONE","body":"## Feature Request\r\n\r\n**Is your feature request related to a problem? Please describe.**\r\nWhen reconcilePeriod is set, Ansible operator runs the playbook for all the CRs regardless of whether the CR has changed or not. When there are hundreds of CRs it is making Ansible operator unresponsive even with 5 cores and multiple workers as it is busy doing the reconcile for the CRs. During the reconcile period if a new CR is created, the initial playbook run for this new CR was taking long time (in some cases more than an hour) as Ansible operator is busy reconciling existing CRs.\r\n\r\n**Describe the solution you'd like**\r\nAnsible operator should only run reconcile for CRs that have changed when reconcilePeriod is set.\r\n"},"comment":{"url":"https://api.github.com/repos/operator-framework/operator-sdk/issues/comments/537129890","html_url":"https://github.com/operator-framework/operator-sdk/issues/1978#issuecomment-537129890","issue_url":"https://api.github.com/repos/operator-framework/operator-sdk/issues/1978","id":537129890,"node_id":"MDEyOklzc3VlQ29tbWVudDUzNzEyOTg5MA==","user":{"login":"fabianvf","id":2431974,"node_id":"MDQ6VXNlcjI0MzE5NzQ=","avatar_url":"https://avatars0.githubusercontent.com/u/2431974?v=4","gravatar_id":"","url":"https://api.github.com/users/fabianvf","html_url":"https://github.com/fabianvf","followers_url":"https://api.github.com/users/fabianvf/followers","following_url":"https://api.github.com/users/fabianvf/following{/other_user}","gists_url":"https://api.github.com/users/fabianvf/gists{/gist_id}","starred_url":"https://api.github.com/users/fabianvf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabianvf/subscriptions","organizations_url":"https://api.github.com/users/fabianvf/orgs","repos_url":"https://api.github.com/users/fabianvf/repos","events_url":"https://api.github.com/users/fabianvf/events{/privacy}","received_events_url":"https://api.github.com/users/fabianvf/received_events","type":"User","site_admin":false},"created_at":"2019-10-01T17:00:28Z","updated_at":"2019-10-01T17:00:28Z","author_association":"CONTRIBUTOR","body":"Unfortunately I don't think there is a guaranteed way to tell if a resource has been changed or not, we get the event stream but because the resource is already changed in etcd all we know is that it needs to be reconciled, but we don't/can't track exactly why. When we refresh based on reconcile period, we have no way of knowing if a resource needs to be reconciled or not, because all we have is the current state of the resource in the cluster.\r\n\r\nIn terms of the time it takes to reconcile, it might be worth increasing the number of workers (if you haven't already). If possible it may also help to add some tasks to your playbook/role that check the cluster state and determine whether you need to do the whole reconciliation process, with conditional imports or the `meta: end_play` task to shorten the loop."}}
{"actor":{"display_login":"fabianvf"}}