Skip to content

Syncing all sources in parallel leads to missing hosts #5571

Closed

Description

@binbashroot
ISSUE TYPE
  • Bug Report
COMPONENT NAME
  • UI
SUMMARY

Using two completely separate satellite sources with the same "Organization" but different "Locations" results in AWX only importing some, but not all, of the hosts into a cumulative inventory.

ENVIRONMENT
  • AWX version: 9.0.1.0
  • AWX install method: docker on linux
  • Ansible version: 2.8.5
  • Operating System: RHEL 7
  • Web Browser: Chrome 79.0.3945.88
  • Red Hat Satellite 6.6
STEPS TO REPRODUCE
  1. Inventories - > Add -> Enter Name ->Save -> Sources -> Add first Satellite server with creds using "Red Hat Satellite 6" for source-> Save
  2. Inventories -> Select previously created inventory -> Sources -> Add -> Add 2nd Satellite server into source -> Save
  3. Select Created Inventory -> Sources -> Click Sync All

"Overwrite, Overwrite Variables, or Update on Launch did not change results.

EXPECTED RESULTS

Expected a total of 350 hosts in Inventory.

ACTUAL RESULTS

Total number of hosts ingested was 180. Cumulative RH Satellite sources results in only a partial number of hosts in the inventory. If two separate inventories are used each utilizing a separate Satellite server, the correct number of hosts are ingested in the inventory.

ADDITIONAL INFORMATION

Activity

  1. blomquisg commented on Feb 28, 2020

    @blomquisg

    @jladdjr check if this is fixed with your inventory plugin work

  2. self-assigned this
    on Feb 28, 2020
  3. jladdjr commented on Feb 28, 2020

    @jladdjr

    Just ran through the steps to reproduce and I'm also finding that an inventory w/ two satellite inventory sources doesn't have the number of hosts I'd expect (a simple sum of the number of hosts returned by each inv. source). Digging to see what's going on. Wondering if this issue is specific to foreman or if it's a more general issue w/ awx inventories / inv. sources.

    Note: In my testing, I used the new foreman plugin which awx is about to adopt.

  4. ryanpetrello commented on Apr 28, 2020

    @ryanpetrello
    Contributor

    @elyezer @squidboylan @kdelee is this something any of you and yours have bandwidth to test now that we've merged the plugin?

    If it doesn't "just work" in the new plugin, we're unlikely to fix it right now.

    cc @blomquisg

  5. jladdjr commented on May 6, 2020

    @jladdjr

    Got side-tracked, poking at this now.

  6. jladdjr commented on May 6, 2020

    @jladdjr

    I believe I'm able to reproduce this. Followed steps given in description and found that an inv source with 59 hosts and another one with 971 yielded an inventory that reported a total of 1023 hosts (instead of 1030).

    I got a list of hosts from each inv. source and, sure enough, found seven ids present in both list. When I look for the associated hostnames of the instances, I can only find them listed in one satellite instance. I think this rules out the possibility that the inventory found duplicate hosts shared by the two sat instances.

    The fact that:

    • seven hosts are missing from the total
    • the list of host id's shows seven overlapping ids
    • but these id's point to hosts only present on a single sat6 host

    .. leads me to think that there's a race condition in awx when hosts are being created.

  7. 11 remaining items

  8. jladdjr commented on May 19, 2020

    @jladdjr

    It looks like we've known this was possible for a while - here's a comment from forever ago:

    FIXME: Wait or raise error if inventory is being updated by another source.

    I've been poking at inventory_import with @AlanCoding and noticed that we're:

    which seems like it would make it possible for guarantees this scenario:

    • Sync 1 gets a snapshot of the inventory
    • Sync 2 gets a snapshot of the inventory
    • Sync 1 gets lock and applies update to inventory
    • Sync 2 gets lock and applies update to old inventory, as it was before Sync 1

    In fact, I think @AlanCoding is correct in putting it more strongly:

    with the sync all, this basically guarantees that it'll have an initial state from before the other sync [my emphasis]

  9. jladdjr commented on May 19, 2020

    @jladdjr

    When we added the advisory lock, we needed to make sure that we read in the current state of the inventory after we got the lock:
    #3529

  10. jladdjr commented on May 19, 2020

    @jladdjr

    Thought #7090 might fix the issue, but I'm still seeing missing hosts even when we force inv. updates to happen serially. Doing some more digging.

  11. changed the title [-]AWX not importing all hosts from Red Hat Satellite sources[/-] [+]Syncing all sources in parallel leads to missing hosts[/+] on May 29, 2020
  12. removed their assignment
    on Jun 15, 2020
  13. ryanpetrello commented on Oct 13, 2020

    @ryanpetrello
    Contributor

    @AlanCoding @jladdjr @elyezer @elyezer I've put this into needs_test, and we're merging #7090, which fixes this issue and also fixes https://github.com/ansible/tower/issues/4576

  14. one-t commented on Oct 28, 2020

    @one-t
    Contributor

    Verified concurrently with #4576

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions