-
Notifications
You must be signed in to change notification settings - Fork 78
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
Possible Bug in DataplaneAPI: Dangling and Duplicated Transaction Files with Concurrent Jobs (HAProxy Terraform Provider) #358
Comments
Here is an example of what we are seeing with concurrent jobs:
Above two files are also present/duplicated in the
|
So Data Plane API operates on optimistic locking using transactions. Meaning that high concurrency isn't available in this case. If multiple transactions are started on one version of the file, only the first one that is committed will succeed, all the rest will be outdated and cannot be committed. Hope this helps your issue? |
@mjuraga thanks for the quick response! While I understand the optimistic locking mechanism, the issue I’m encountering is with the cleanup process in multi-workspace scenarios. When running multiple workspaces concurrently (around 13), I’m seeing the following:
The provider handles concurrency by implementing a retry mechanism when a transaction version or commit becomes outdated. However, the cleanup process seems to fail in high-concurrency scenarios, leaving outdated files behind. |
oh, I understand now, thank you, we can treat this as a bug and fix it. I'll get back to you with a fix. |
Description:
I have encountered a potential bug in the DataplaneAPI while working on an HAProxy provider. The issue arises when running concurrent jobs that interact with the API across multiple workspaces.
The problem does not occur when using a single workspace. Specifically:
This behavior suggests there might be an issue with transaction isolation or handling in high-concurrency, multi-workspace scenarios.
Steps to Reproduce:
Use my HAProxy provider available on the Terraform Registry: https://registry.terraform.io/providers/cepitacio/haproxy/latest
Check the transaction directories:
Expected Behavior:
Actual Behavior:
Environment:
DataplaneAPI version: reproduced with
v2.9.2
andv2.9.8
HAProxy version: 2.9.0
Terraform provider: https://registry.terraform.io/providers/cepitacio/haproxy/latest
Additional Notes:
I am relatively new to Go and Terraform provider development, so I might have missed something in my implementation. However, the issue seems to be directly related to the API's behavior under concurrent requests.
The issue does not occur when jobs are executed sequentially in a single workspace, which suggests it may be related to handling concurrent API transactions across workspaces.
The text was updated successfully, but these errors were encountered: