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

Auto-snapshot out of sync with current flows #4791

Open
knolleary opened this issue Nov 18, 2024 · 3 comments
Open

Auto-snapshot out of sync with current flows #4791

knolleary opened this issue Nov 18, 2024 · 3 comments
Assignees
Labels
bug Something isn't working needs-triage Needs looking at to decide what to do
Milestone

Comments

@knolleary
Copy link
Member

Current Behavior

Reported by customer on FFC - the latest auto-snapshot of their instance is different to the current deployed flows. Not sure how that is possible - nor if it can be recreated. I did look at their snapshot/flows and confirmed the difference.

Worth noting the snapshot was 2.4Mb in size - in case there's a timing issue here.

Expected Behavior

Auto-snapshot to reliably be the latest deployed flows.

Steps To Reproduce

Unknown

Environment

  • FlowFuse version:
  • Node.js version:
  • npm version:
  • Platform/OS:
  • Browser:

Have you provided an initial effort estimate for this issue?

I can not provide an initial effort estimate

@knolleary knolleary added bug Something isn't working needs-triage Needs looking at to decide what to do labels Nov 18, 2024
@knolleary
Copy link
Member Author

knolleary commented Nov 18, 2024

This may be related to the async update of flows and credentials. The snapshot contains the latest flows, but not credentials - not proven.

@atorich-th
Copy link

atorich-th commented Nov 18, 2024

I am the

customer on FFC

This may be related to the async update of flows and credentials. The snapshot contains the latest flows, but not credentials - not proven.

Not confirmed. The last auto snapshot have the previous version of flows and credentials both. Just checked it.

@knolleary
Copy link
Member Author

I have confirmed this is a timing issue.

The auto-snapshot is triggered when the Node-RED instance logs the flows.set audit event.

Within the Node-RED codebase, the audit event is logged immediately before the flows/credentials are passed to the storage layer to be saved.

If the flows/credentials are sufficiently large, a timing window opens up where the auto-snapshot is created before Node-RED has finished saving the flows/credentials.

We need to move the trigger for auto-snapshot out of the audit-log handler and over to the storage api.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage Needs looking at to decide what to do
Projects
Status: Todo
Development

No branches or pull requests

2 participants