Skip to content

perf(controller,satellite): read only a definition's replicas, not every Resource - #303

Merged
Andrei Kvapil (kvaps) merged 19 commits into
mainfrom
fix/narrow-replica-lists
Nov 23, 2026
Merged

Andrei Kvapil (kvaps) merged 19 commits into
mainfrom
fix/narrow-replica-lists

Conversation

@kvaps

@kvaps Andrei Kvapil (kvaps) commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

What this reduces

A burst of 16 replicated volumes no longer timed out on v0.4.0-alpha.7, but each CreateVolume still took about 30 seconds, and the six volumes waiting for a free provisioner worker took about 60. A third of the autoplace calls ended on the 30-second deploy bound. The satellites spent that time running passes slowly, and the controller handed out DRBD identities slowly. Neither was waiting on DRBD.

Root cause

The controller and every satellite run at their CPU limit (500m) while the cluster is idle. On the test cluster with about 400 replicas, cAdvisor shows the satellites throttled in 82 to 94 percent of CFS periods, at about 0.48 cores used on average. The controller is throttled in 87 percent of periods. A burst then runs on what is left.

Two reads cause most of that load, and both read every Resource in the cluster past the cache, which is about 1.5 MB of JSON at 400 replicas:

  • The ResourceDefinition reconciler requeues every definition every five seconds, and each pass lists every Resource uncached to count the definition's replicas for the tiebreaker (listReplicasDirect). With 180 definitions that is about 36 whole-cluster lists a second. In an envtest profile with 411 replicas this one read took 38 percent of the controller's CPU, and the controller used 0.50 cores while doing nothing but take four status writes a second.
  • Every satellite pass of every replica, the periodic re-checks included, lists every Resource uncached to find the replica's peers (listPeerResources). It was the largest satellite cost in the same profile.

The CRD already declares spec.resourceDefinitionName selectable, and the store already uses it for definition-scoped reads.

Changes

  • The controller reads only the definition's replicas. listReplicasDirect asks the API server for the definition's replicas, with one field-selected list per spelling of the name. The spellings are the ones the store knows plus every spelling a replica in the cache carries, so a replica written under another spelling is still counted.
  • The satellite reads only the replica's peers. listPeerResources uses the same read. A peer the read misses would be left out of the rendered .res, so the cache-observed spellings matter here too.
  • Fallback. A server or cache that cannot serve the selector fails the read rather than answering short, and the read then falls back to the whole-cluster list, as before. When the API server refuses the field because the CRD predates it, that is remembered for the process, so later reads send the one whole-cluster list they always did instead of three requests.
  • Cheap cache lookups. Which spellings the cached replicas carry is answered from a cache index on the key of the definition name, which the controller registers with the store's other indexes and the satellite registers on its own manager. The definition's own spellings come from the cache when it holds the definition. Without these, each pass still copied every cached Resource and sent one extra request to the API server.
  • Order. The replicas come back sorted by object name, as the whole-cluster list returned them.
  • What the scoped read can miss. A field selector matches one spelling exactly. A replica applied by hand under a spelling that neither the definition nor the cache knows yet is missed until the next pass, a few seconds later. Nothing blockstor writes is such a replica: the store, the controller and the LINSTOR migration all write the definition's object name, which is always asked for. A replica already connected to its peers has long been in the cache, so this can delay a new peer but cannot drop a running one. The doc comment of ReplicasOf says so.
  • A witness grown during a placement is taken over. The placer writes a placement's replicas one at a time, and the tiebreaker reconciler sees the definition between those writes. With the scoped read it is fast enough to see the two diskful replicas of a three-replica spawn and put a TIE_BREAKER witness on the node the third one is for, before the placer creates it. The placer's create then found the witness, took "already exists" for its replica and reported the placement done. The definition stayed two diskful replicas and a witness until a later placement promoted the witness two to three minutes on. The race is older than this change: the whole-cluster read only made the reconciler slower than the gap between two creates. LINSTOR places a diskful replica over a TieBreaker by taking the witness over, and the placer already did so for a witness it saw before it started. A diskless replica found by the create is now promoted the same way; a diskful one written meanwhile is left as it is.
  • The take-over decides on the live replica. The promotion looks at the replica it patches, not at what the placement read earlier. A witness that is already being deleted is not promoted and the node counts as not placed, so the placement reports one replica short instead of counting a replica that is gone a moment later; this also covers a witness the placement saw before it started. A witness that turned diskful meanwhile is left as it is. When the witness vanishes and the fallback create finds a new one written in between, that one is taken over too rather than counted unseen, for up to three rounds.
  • Benchmark. tests/integration/burst_provisioning_test.go drives the burst linstor-csi sends: 16 volumes behind 10 workers, each placed in two autoplace calls, through the REST server, the controller and one real satellite resource reconciler per node, on nodes that already hold volumes. It measures how long each create takes until its replicas are built and ready, which is when LINSTOR answers. It runs only with BURST_BENCH=1.

The cause is not in an open PR branch: both reads are on main and have been there since May. The commits apply cleanly on top of the v0.4.0-alpha.7 stack.

Testing

  • go vet ./..., go test ./... with envtest, make lint-config and make lint (0 issues), all with Go 1.25.7.
  • The naming provenance guard (pkg/naming, TestNamesAreComparedAsKeys) passes with the refilters after ReplicasOf removed.
  • New unit tests: the controller's replica read and the satellite's peer read send no unscoped Resource list and still find every replica; ReplicasOf finds a replica under a spelling only the cache knows, and falls back to the whole-cluster read when the selector is refused. With their part of the fix reverted, the two scope tests fail ("read every Resource in the cluster 1 time(s)"). With the cache spellings dropped, the spelling test fails because it misses the replica.
  • Tests for the review follow-ups, each checked by reverting its fix line and watching it fail: the cached spellings are looked up through the definition-key index rather than a walk of the whole cache (fails with "walked every cached Resource 1 time(s)"); the store's manager and the satellite's manager (envtest) both register that index; after the server refuses the selector, a later read sends one whole-cluster list instead of three requests (fails with "sent 3 requests"); a definition held in the cache is not fetched from the API server (fails with "asked the API server for the definition 1 time(s)"); the replicas come back in object name order (fails with "in order [pvc-mix.n2 pvc-mix.n1]").
  • Controller CPU, envtest, 411 replicas, four status writes a second for 30 seconds: 0.50 cores before, 0.16 after (v0.4.0-alpha.7 stack with and without the first two commits).
  • Burst benchmark on the final branch, v0.4.0-alpha.7 stack with and without these commits, 137 existing volumes (411 replicas), 100 ms per drbdadm call, GOMAXPROCS=2 for the whole process (controller, REST server, three satellites), on a shared workstation: burst 26.3 s and 30.1 s in two runs before, 15.8 s after; slowest CreateVolume 20.4 s and 22.9 s before, 12.7 s after; median CreateVolume about 15 s before and 8.6 s after; 16 of 16 creates over 10 s in both runs before, 5 of 16 after. The numbers move with the machine's load, so read them as a range rather than a figure.
  • Integration tests (-tags=integration, TestGroupKWF and TestSmoke) on this branch: all passed in a second run. In the first, TestGroupKWFHappyPath failed once while another build ran on the workstation; it passed in the rerun of the group and in seven runs on its own.
  • The placement race, found on the v0.4.0-alpha.8 test cluster: a REST spawn of three diskful replicas came up with a TieBreaker on its third node (seen in r l) and took 2 to 3 minutes to be ready, against 6 to 13 s on v0.4.0-alpha.7. A DRBD watcher on the cluster saw the spawn's first replica suspended once, 9 s after the spawn, with its connection to the third node still Connecting; the watcher does not tell the suspend reasons apart, so whether quorum was the reason is not established.
  • New integration test TestSpawnThreeDiskfulTakesOverTheWitnessGrownMeanwhile reproduces the race on envtest with the controller, the REST server and three satellite reconcilers. The burst stack now takes the latency of a replica create (100 ms) and of a whole-cluster Resource read (400 ms, Resource lists only), which envtest otherwise answers in a fraction of. Four three-replica autoplaces each check that no replica is a witness once the autoplace answers and that all three come up. Without the placer fix three of the four end with a witness (the first, on a cold controller, does not race). With the controller reading every Resource at 400 ms and without the placer fix, none of six did, which is why the race stayed hidden. With the fix, four of four and three runs of six of six came up three diskful.
  • New placer tests: a store in which a TIE_BREAKER witness appears on the third node as soon as the second diskful replica is written. Without the fix the placement ends with the witness on that node and fails; a second test pins that a diskful replica written meanwhile keeps its pool. For the take-over follow-ups: a witness being deleted, written during the placement or seen before it, is not promoted and the placement reports two of three; a witness that vanishes under the promotion and is written again before the fallback create is taken over too. Each fails with its part of the fix removed ("placed 3 of 3, want 2 of 3", "n3: flags [DISKLESS TIE_BREAKER], want a diskful replica").
  • Placement integration tests (TestGroupKWF*, TestGroupFRAutoPlace*, TestGroupFRToggleDiskful2DisklessReapsTieBreaker, TestGroupCRGSpawnResources, TestSpawnThreeDiskfulTakesOverTheWitnessGrownMeanwhile) pass on the final head. The full integration suite on the final head passed except TestGroupKWFHappyPath, which timed out once waiting for its snapshot ("Snapshot wf-happy.snap-1 not created") while the other branch's suite was compiling; it passed five runs on its own right after, and passed in the group run.

Not tested

  • On a real cluster: not deployed. The throttling numbers above come from the v0.4.0-alpha.7 test cluster before this change.
  • With the same 500m limits per pod: the benchmark runs every component in one process, so GOMAXPROCS only approximates them.
  • The cause of the TestGroupKWFHappyPath failures: twice now it timed out waiting for its snapshot under load and passed on its own each time, which points at timing under load, not proven.
  • The placer fix on the test cluster: not deployed yet.
  • The take-over of a witness being deleted on the Kubernetes store: the unit test models it with the in-memory store and the DELETE flag, which the Kubernetes store shows for a Resource with a DeletionTimestamp.

Known limitations

This removes the largest CPU cost at idle, but not every part of the burst latency. In the benchmark a create still takes several seconds per autoplace under contention. What remains is the number of satellite passes a new replica goes through before its device is reported. These include the finalizer pass with its five-second requeue, the waits for the controller's allocation, and peer passes that each run a full drbdadm adjust, together with the 500m CPU limit in the deployment manifests. Those are separate changes.

The witness still appears for the moment between the second and the third create before the placer promotes it, and the controller sets the definition's quorum for it in between. LINSTOR writes the replicas of an autoplace in one transaction and never shows it. Keeping the reconciler from growing a witness while a placement runs needs a signal between the REST server and the controller and is left out here.

Merging into the v0.4.0-alpha stack: tryPlace there also records the nodes a placement deployed to and created on (#291 and the snapshot-delete branch). A witness the create takes over belongs in the deployed list and not in the created one, as for a witness seen before the placement started, and so does the replica the take-over lands through its fallback create. A node whose witness was being deleted is in neither list, since nothing was placed there.

No witness during a placement

What this fixes

A three-replica spawn on v0.4.0-alpha.12 left one connection of the new resource StandAlone for ten minutes. One replica's kernel had set its peer up as a diskless peer, and when that peer came up diskful the handshake failed with The peer is configured to be diskless but presents Inconsistent. One spawn of two on the test cluster hit it.

Root cause

The peer had been a TIE_BREAKER witness for about a second. The placer writes a placement's replicas one at a time, and the tiebreaker reconciler, reading only the definition's replicas since this PR, sees the first two of three as the even-diskful tie a witness breaks and puts one on the node the third replica is for (controller log: ensureTiebreaker replicas: 2, diskful: 2, witness: 0, willCreate: true). The placement then takes the witness over as diskful, which settles the count, but by then the first two replicas have rendered and brought up the witness as a diskless peer. LINSTOR decides on the witness once the whole placement is written, in the same transaction, so it never shows one there.

Changes

  • A placement holds the witness while it writes. A placement of more than one diskful replica stamps blockstor.org/placement-in-progress-until on the definition before its first create and removes its own stamp when it is done, which wakes the definition's reconciler. A placement of one replica writes nothing.
  • The reconciler adds no witness while a placement is in progress. The stamp is a deadline one minute out, so a placement that never removes it (a process that died mid-way) delays a witness by at most that long. The take-over of a witness written meanwhile stays as the fallback for a stamp that could not be written.
  • Each placement keeps its own hold. Placements of one definition run in the REST server and in the controller, and the in-process lock does not serialise them across processes. The annotation lists one deadline per placement, each placement adds and removes only its own, and expired entries left by a placement that died are dropped on the next write. The reconciler holds while any entry is due.
  • An explicit multi-node create holds the witness too. linstor r c n1 n2 n3 rd writes its replicas one at a time just like a placement, while LINSTOR writes them in one transaction. A request with two or more diskful replicas now holds the witness until all of them are written; a single replica or a diskful one next to a diskless one writes nothing.

When merged with #308, which replaced the 5-second requeue with a requeue at the witness deadlines, nextTiebreakerDeadline must also come back at the latest due placement hold, read with apiv1.PlacementInProgressUntil (the value is a list, so adding the key to the time.Parse loop is not enough). A test here fails on that merge until it does: a reconcile under a placement hold must requeue within the hold.

Testing

  • pkg/placer: every create of a three-replica placement sees the stamp, the stamp is gone afterwards, and a one-replica placement never writes it. Fails with the hold or its removal taken out.
  • pkg/placer: two holds on one definition, the later one released first, leave the earlier one in force, and releasing both leaves no annotation. Fails with the single-value stamp this replaces.
  • pkg/rest: r c of three diskful replicas sees the hold at every create and leaves none behind; one diskful replica, and one diskful next to a diskless one, write nothing. Fails without the hold, and the diskless case fails when diskless envelopes are counted.
  • pkg/api/v1: adding, removing and reading the per-placement holds, including expired and unparseable entries.
  • internal/controller: two diskful replicas with a live stamp get no witness, also when the live stamp sits next to an expired one; with only an expired stamp they get one. Fails with the gate taken out, and the list case fails with a single-value parse. A reconcile under a placement hold requeues within the hold; fails with the requeue removed, and fails on a trial merge with perf(controller): stop re-reading every definition every 5 s #308 until nextTiebreakerDeadline reads the hold.
  • tests/integration: the three-replica spawn at cluster latency (100 ms a create, 400 ms a whole-cluster read) now watches the Resources during the autoplace and fails on any witness. Without the hold three of four spawns show one on the third node; with it none does.
  • make lint-config && make lint: 0 issues. go test ./... and the integration suite pass.

Not tested

  • On the test cluster: the race shows in about one spawn of two there and was reproduced in envtest at the same latencies, not on the cluster itself.
  • Two placements of one definition running at the same time in different processes, and a r c of three nodes, end to end: both are covered by unit tests against the in-memory store only.
  • A controller from before this change reads a hold listing two placements as no hold and falls back to the take-over; that mixed-version window was not exercised.

Every ResourceDefinition requeues every five seconds, and each pass
read every Resource in the cluster past the cache to count the
definition's replicas for the tiebreaker. On a cluster with about
four hundred replicas that is a few megabytes of JSON per pass and
dozens of passes a second: the controller sat at its CPU limit while
idle, and a burst of new volumes waited seconds for their DRBD
identities behind it.

The read now asks the API server for the definition's replicas only,
one field-selected list per spelling of its name, including every
spelling a replica in the cache carries. A server or cache that
cannot serve the selector still gets the whole-cluster read.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
Every pass of every replica on a node, the periodic re-checks
included, read every Resource in the cluster past the cache to find
the replica's peers. On a node with a hundred replicas in a cluster
of four hundred that kept the satellite at its CPU limit while idle,
so the passes of new replicas ran throttled and their devices
appeared tens of seconds late.

The read now asks for the replica's definition only, the same way
the controller does.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
A benchmark of the provisioning burst linstor-csi sends: sixteen
volumes behind csi-provisioner's ten workers, each placed in two
autoplace calls, through the REST server, the controller and one
real satellite resource reconciler per node, on nodes that already
carry volumes. It reports how long each create took to have its
replicas built and ready, which is when LINSTOR answers it.

It takes minutes, so it runs only with BURST_BENCH set.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
ReplicasOf asks the cache which spellings of a definition its replicas
carry, on every pass of every definition on the controller and of every
replica on a satellite. Without an index that is a copy of every cached
Resource into a fresh list each time: far cheaper than the uncached
whole-cluster read it replaced, but still linear in the cluster and paid
dozens of times a second.

Index the cache by the key of the definition name, so the lookup touches
that definition's replicas only. The controller gets it with the rest of
the store's indexes; the satellite builds its own manager and registers
it there. A cache without the index still answers, by the full walk.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
Each ReplicasOf call asked the API server for the definition to learn
its spellings, a request per pass of every definition and every
replica. Those spellings are fixed when the definition is created, so
the cache's copy names them as well as the server's does. Ask the
server only when the cache has not seen the definition yet.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
On a cluster whose Resource CRD predates the selectable field every
ReplicasOf call sent the definition lookup and a refused list before
the whole-cluster read it ends on, three requests where there used to
be one. Remember the server's refusal for the process and go straight
to the whole-cluster read. The CRD and the binaries ship in one
release, so the process is replaced before a CRD that would accept
the selector arrives.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
The whole-cluster list ReplicasOf replaced came back sorted by object
name. The scoped read concatenated its answers spelling by spelling,
so a definition whose replicas carry mixed spellings came back in a
different order. Sort, so callers see the order they always did.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
A field selector matches one spelling exactly, so a replica applied by
hand under a spelling neither the definition nor the cache knows yet is
missed until the next pass. Say so where the read is defined, along
with why nothing blockstor writes is such a replica and why the store's
own definition reads differ from this one.

ReplicasOf already answers only the definition's replicas, so the
callers' second filter by definition name is dead code.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
Registering the cached-replica index pushed NewManager past the funlen
budget. The five reconciler registrations are one step with one error
shape, so they move out together and NewManager keeps the ordering.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
The remembered selector refusal is process-wide by design: it is a
fact about the one API server the process talks to, so it stays a
package variable with the reason stated. The test export becomes a
function rather than a second global, the refusal test drops a
nolint directive paralleltest never needed, and the index test
preallocates its object list.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 15 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 789d5015-abd3-40b7-a6f1-afbb5ac00d26
Commits

Reviewing files that changed from the base of the PR and between 216e577 and b76a89e.

Files selected for processing: 24

  • internal/controller/ensure_tiebreaker_test.go
  • internal/controller/placement_hold_requeue_test.go
  • internal/controller/rd_replica_read_scope_test.go
  • internal/controller/resourcedefinition_controller.go
  • pkg/api/v1/annotations.go
  • pkg/api/v1/placement_hold.go
  • pkg/api/v1/placement_hold_test.go
  • pkg/placer/placer.go
  • pkg/placer/witness_hold.go
  • pkg/placer/witness_mid_placement_test.go
  • pkg/placer/witness_takeover_test.go
  • pkg/rest/autoplace.go
  • pkg/rest/witness_hold_create_test.go
  • pkg/satellite/controllers/manager.go
  • pkg/satellite/controllers/peer_read_scope_test.go
  • pkg/satellite/controllers/replica_key_index_test.go
  • pkg/satellite/controllers/resource.go
  • pkg/store/k8s/field_index.go
  • pkg/store/k8s/field_index_retry_test.go
  • pkg/store/k8s/manager_export_test.go
  • pkg/store/k8s/replicas_of.go
  • pkg/store/k8s/replicas_of_test.go
  • tests/integration/burst_provisioning_test.go
  • tests/integration/spawn_three_diskful_test.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

The placer writes a placement's replicas one at a time. The
controller's tiebreaker reconciler sees the definition between those
writes, and at two diskful replicas of a three-replica placement it
puts a TIE_BREAKER witness on the node the third one is for. The
placer's create then found that witness, took "already exists" for
its replica and reported the placement done. The definition stayed
two diskful replicas and a witness until a later placement promoted
the witness, two to three minutes on, with the first replica
suspended without quorum meanwhile.

The race was always there; it was hidden while the reconciler read
every Resource in the cluster, which took longer than the gap
between two creates. Reading only the definition's replicas made the
reconciler fast enough to land the witness inside the gap.

LINSTOR places a diskful replica over a TieBreaker by taking the
witness over, and the placer already does so for a witness it saw
before it started. A diskless replica found by the create is now
promoted the same way; a diskful one is left as it is.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
The placer promoted whatever replica it found on the node. A witness
the controller was already deleting got its flags stripped and was
counted as placed, so the placement reported a replica that was gone
a moment later. A witness that vanished and was written again between
the promote and its fallback create was counted as the diskful replica,
the bug the take-over fixes, one step further on.

The promotion now decides on the replica it patches: one being deleted
leaves the node unplaced, one that turned diskful is left as it is,
and a create that finds a replica again goes back to the promotion
for a bounded number of rounds.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
The race between the placer and the tiebreaker reconciler only shows
when a replica create takes longer than the controller's pass over the
definition, which envtest never does. The burst stack now takes the
latency of a create and of a whole-cluster Resource read, and a
three-replica spawn at 100 ms and 400 ms checks that no witness is left
on any node once the autoplace answers.

Without the placer's take-over three of four spawns end with a witness;
with the controller reading every Resource at 400 ms none does, which
is why the race stayed hidden.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
A three-replica spawn came up with one connection StandAlone for good.
The placer writes the replicas one at a time, and the tiebreaker
reconciler, seeing the first two, put a TIE_BREAKER witness on the node
the third was for. The placement took the witness over as diskful, but
the first two replicas had set it up as a diskless peer by then, and
one kernel refused the handshake with "The peer is configured to be
diskless but presents Inconsistent".

LINSTOR decides on the witness once the whole placement is written, in
the same transaction. A placement now says it is in progress with an
RD annotation, and the reconciler adds no witness while it is due; the
deadline only bounds a placement that never got to remove it.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
A placement of more than one diskful replica stamps the RD as in
progress before its first create and removes the stamp when it is
done, so the tiebreaker reconciler decides on the replicas it placed
rather than on the first two of three. The take-over of a witness
written meanwhile stays as the fallback for a stamp that could not be
written. A placement of one replica passes through no other shape and
writes nothing.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
The spawn test checked the replicas once the autoplace answered, when
a witness the placement took over is already gone. A watch on the
Resources now records every witness of the definition while it runs.
Without the placement's hold three of four spawns show one on the
third node, which is what left a peer's connection StandAlone.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
Placements of one definition run in the REST server and in the
controller, and lockDefinition serialises them within one process
only. The second placement overwrote the first one's stamp and removed
it when it finished, so the first went on writing replicas with no
hold, and the tiebreaker reconciler could put a witness on a node it
was about to make diskful.

The annotation now lists one deadline per placement. Each adds its
own, removes only its own and drops the expired ones of placements
that never removed theirs; the reconciler holds while any is due.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
`linstor r c n1 n2 n3 rd` writes its replicas one at a time, the same
as a placement, but took no hold. After the second create the
tiebreaker reconciler saw an even-diskful tie and put a witness on n3,
which n1 and n2 set up as a diskless peer before the third create took
it over as diskful: the race the placement hold closes. LINSTOR writes
the whole request in one transaction. A request for two or more
diskful replicas now holds the witness until it is written.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
A placement that dies before it removes its hold leaves two diskful
replicas and no witness, and nothing wakes the definition again. Here
the 5 s requeue brings it back; the change that drops that requeue for
deadline-driven ones must count the placement hold among the deadlines
and read it as the list it is, or this test fails instead of a cluster
sitting in the split-brain shape until the next resync.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went through ReplicasOf and its fallback, the definition-key index on both managers, the per-placement hold and its release, and the live-replica take-over. I found nothing blocking. The take-over of a diskless replica matches upstream autoplace, which passes nodes with an existing diskless replica to setSkipAlreadyPlacedOnNodeNamesCheck (CtrlRscAutoPlaceApiCallHandler). The #308 merge note in the description is the one thing to carry: whichever of the two lands second needs nextTiebreakerDeadline to read the placement hold.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants