Skip to content

fix(fabric): stop channel config updates from racing orderer reads (backport #2608) - #2616

Merged
mbrandenburger merged 1 commit into
release-0.29from
mergify/bp/release-0.29/pr-2608
Nov 12, 2026
Merged

mbrandenburger merged 1 commit into
release-0.29from
mergify/bp/release-0.29/pr-2608

Conversation

@mergify

@mergify mergify Bot commented Nov 12, 2026

Copy link
Copy Markdown

Summary

config.Service.SetConfigOrderers replaced the orderer list with no lock while the broadcasters read it on other goroutines, and its in-place append could overwrite the entries an in-flight BFT broadcast was still sending to. The Fabric-x channel config monitor calls it for every new channel config, and Fabric-x maps arma to BFT, so every Fabric-x node takes this path; the Fabric committer calls it for config transactions.

Fixes #2603.

Changes

  • platform/fabric/core/generic/config/service.go:
    • orderers gets its own sync.RWMutex, held by Orderers and SetConfigOrderers. It is separate from mu, so pick can still take mu for the failure cooldowns;
    • SetConfigOrderers builds a new slice with slices.Concat, so a slice Orderers returned is never written to;
    • PickOrderer reads the list through Orderers;
    • Orderers and SetConfigOrderers get godoc that states this.

No API change. No documentation describes this code.

Testing

Two tests in platform/fabric/core/generic/config/service_test.go:

Test Without the fix With the fix
TestSetConfigOrderers_keepsReturnedSliceIntact: a slice taken from Orderers keeps its entries after a later update fails (expected: "o1", actual: "o3") pass
TestSetConfigOrderers_concurrentWithReaders: updates while PickOrderer and Orderers read -race reports a data race pass
  • go test -race on platform/fabric/core/generic/config, platform/fabric/core/generic/ordering and platform/fabricx/core/channel/...: pass
  • make checks: 0 issues

Backport

release-0.29: every Fabric-x node on v0.29.0 takes this path (arma maps to BFT), so a config update during a broadcast can send to the wrong orderers. The fix changes no API, schema step or wire format, and waiting for v0.30.0 leaves v0.29 nodes exposed until then.


This is an automatic backport of pull request #2608 done by Mergify.

@mergify

mergify Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Author

This pull request is merged.

…2608)

SetConfigOrderers replaced the orderer list with no lock while the
broadcasters read it on their own goroutines: the CFT broadcaster
through PickOrderer, the BFT broadcaster by ranging over Orderers. The
Fabric-x channel config monitor calls it for every new channel config,
and the Fabric committer for every config transaction.

The update also appended to the configured orderers in place, so once
the backing array had room, a config update overwrote the entries a
BFT broadcast was still sending to. That broadcast had already sized
its quorum from the old list and could reach the wrong orderers, or
the same one twice. Fabric-x maps arma to BFT, so every Fabric-x node
takes this path.

The orderer list now has its own RWMutex, and SetConfigOrderers builds
a new slice, so a slice Orderers returned is never written to.
PickOrderer reads the list through Orderers. The lock is separate from
mu so that pick can still take mu for the failure cooldowns.

Fixes #2603

Signed-off-by: Marcus Brandenburger <bur@zurich.ibm.com>
@mbrandenburger
mbrandenburger force-pushed the mergify/bp/release-0.29/pr-2608 branch from 4fe261e to 44b6302 Compare November 12, 2026 07:35
@mbrandenburger
mbrandenburger merged commit 157483b into release-0.29 Nov 12, 2026
57 checks passed
@mbrandenburger
mbrandenburger deleted the mergify/bp/release-0.29/pr-2608 branch November 12, 2026 07:36
@mbrandenburger mbrandenburger added this to the 26Q4 milestone Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant