Skip to content

FileProvider: Use a per-process unique temporary lodev file name - #512

Open
mateo-moon wants to merge 1 commit into
LINBIT:masterfrom
mateo-moon:fix/lodev-tmp-race
Open

FileProvider: Use a per-process unique temporary lodev file name#512
mateo-moon wants to merge 1 commit into
LINBIT:masterfrom
mateo-moon:fix/lodev-tmp-race

Conversation

@mateo-moon

Copy link
Copy Markdown

Fixes #511.

Problem

Special satellites spawned by the controller (e.g. EBS_TARGET nodes) all run within the controller's container and share /var/lib/linstor.d. Every device-manager cycle ends in FileProvider.clearCache(), which writes loop_device_mapping.tmp and atomically renames it — even with zero loop devices. Concurrent cycles of co-located satellites race on the shared temp file: one renames it away, the other's rename throws NoSuchFileException, and that satellite's whole device-manager cycle aborts. With three per-AZ EBS targets this fires regularly and leaves freshly dispatched resources stuck Unknown (live evidence in #511).

Fix

Use a per-process unique temporary file name (loop_device_mapping.tmp.<pid>), keeping the atomic-rename pattern while making co-located satellites' cycles independent. Behavior for the normal one-satellite-per-host case is unchanged.

Testing

  • :satellite:compileJava + :satellite:checkstyleMain clean (no new findings).
  • End-to-end on the live reproducing cluster (3 EBS targets, arm64/K8s): being validated with a patched v1.34.1 image; results will be posted here.

Multiple satellite processes may share the same /var/lib/linstor.d
directory: the special satellites (e.g. EBS targets) that the controller
spawns all run within the controller's container. Their concurrent
device manager cycles race on the shared loop_device_mapping.tmp: one
process renames the file away and the others' rename then fails with a
NoSuchFileException, which aborts their entire device manager cycle.
For EBS target satellites this leaves freshly dispatched resources
undeployed (stuck Unknown) even though the corresponding EBS volume may
already have been created.

Using a per-process unique temporary file name keeps the atomic-rename
pattern while making concurrent cycles of co-located satellites
independent of each other.
@mateo-moon

Copy link
Copy Markdown
Author

E2E-validated live on a 3-AZ Kubernetes cluster (arm64/Nitro, v1.34.1 base + all four of our EBS fix PRs): full validation report in #506 (comment) (latest comment). Highlights relevant to this PR are listed there; the four fixes together make native EBS work end-to-end on latest.

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

Labels

None yet

Projects

None yet

1 participant