Skip to content
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

bug: schema out of sync on workers after deleting a node from the schema #4836

Closed
wvandeun opened this issue Nov 3, 2024 · 1 comment · Fixed by #5183
Closed

bug: schema out of sync on workers after deleting a node from the schema #4836

wvandeun opened this issue Nov 3, 2024 · 1 comment · Fixed by #5183
Assignees
Labels
group/backend Issue related to the backend (API Server, Git Agent) priority/1 This issue must be fixed/implemented ASAP, it's a blocker for a release type/bug Something isn't working as expected

Comments

@wvandeun
Copy link
Contributor

wvandeun commented Nov 3, 2024

Component

API Server / GraphQL

Infrahub version

1.0.1

Current Behavior

The schema between different workers goes out of sync, when you delete an existing schema node from the schema.

Expected Behavior

All the workers load the new schema and the schema is in sync between them.

Steps to Reproduce

  • load an instance of infrahub
  • load this schema
---
version: "1.0"
nodes:
  - name: Device
    namespace: Network
    human_friendly_id: ['hostname__value']
    attributes:
      - name: hostname
        kind: Text
        unique: true
      - name: model
        kind: Text
  - name: Interface
    namespace: Network
    attributes:
      - name: name
        kind: Text
      - name: description
        kind: Text
        optional: true
  • execute this GraphQL query, the schema has should be in sync, take note of the hash of one of the nodes
query {
  InfrahubStatus {
    summary {
      schema_hash_synced
    }
    workers {
      edges {
        node {
          schema_hash
        }
      }
    }
  }  
}
  • load this schema, the NetworkInterface should be deleted from the schema
---
version: "1.0"
nodes:
  - name: Device
    namespace: Network
    human_friendly_id: ['hostname__value']
    attributes:
      - name: hostname
        kind: Text
        unique: true
      - name: model
        kind: Text
  - name: Interface
    namespace: Network
    state: absent
    attributes:
      - name: name
        kind: Text
      - name: description
        kind: Text
        optional: true
  • execute the following Graphql query
```graphql
query {
  InfrahubStatus {
    summary {
      schema_hash_synced
    }
    workers {
      edges {
        node {
          schema_hash
        }
      }
    }
  }  
}

The workers are now not in sync anymore. Only 1 worker will have a new schema hash, the other workers still have the old hash from the previous step.

Additional Information

No response

@wvandeun wvandeun added type/bug Something isn't working as expected group/backend Issue related to the backend (API Server, Git Agent) labels Nov 3, 2024
@exalate-issue-sync exalate-issue-sync bot added this to the Infrahub - 1.0.x milestone Nov 3, 2024
@dgarros dgarros self-assigned this Nov 5, 2024
@exalate-issue-sync exalate-issue-sync bot added priority/2 This issue stalls work on the project or its dependents, it's a blocker for a release priority/1 This issue must be fixed/implemented ASAP, it's a blocker for a release and removed priority/2 This issue stalls work on the project or its dependents, it's a blocker for a release labels Nov 12, 2024
@BaptisteGi
Copy link
Contributor

Same issue but different way to trigger it:

  • load schema to main
  • create a branch
  • load schema to delete the NetworkInterface on the new branch
  • merge to main

=> We still have the deleted node on main (same schema out of sync)
=> A reboot of infrahub does put all workers on the same page

https://discord.com/channels/1212332642801025064/1306016379102560328

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
group/backend Issue related to the backend (API Server, Git Agent) priority/1 This issue must be fixed/implemented ASAP, it's a blocker for a release type/bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants