Repository navigation
Description
One SMB share reached at several addresses (for example the LAN IP, a VPN address like Tailscale, and the mDNS name) becomes several volumes today. smb_volume_id keys on the address as mounted, so each alias gets its own index, writer, and scan.
What it costs (docs/notes/performance/thread-and-connection-inventory-2026-09-22.md): for each extra alias, two writer threads, an FSEvents stream, 32 MiB of page-slab budget, and a duplicate scan over the network. It only affects setups that reach one share at 2+ addresses, and nobody has measured the idle CPU and RAM of that.
How to recognize the same share: a fingerprint read after connecting
- ServerGuid: every SMB2/3 server sends a 16-byte GUID in its NEGOTIATE response. It identifies the server itself, not the address, and Samba and Windows both keep it across restarts.
smb2already parses and exposes it (server_guidin the negotiate parameters); Cmdr doesn't use it yet. - Share name: compared case-insensitively.
- The underlying volume:
FileFsVolumeInformationgives a volume serial number and creation time, as a second fingerprint that has to match too.
Design sketch: an alias-adoption layer
- After a connection, look for an existing volume with the same fingerprint. If there is one, adopt its index instead of creating a new one.
- Don't use
same_server*as a key: it's a predicate that depends on live mDNS state.
Risks
- Cloned servers: two different servers made from the same VM or container image can share a GUID, if Samba's state was baked into the image. Cmdr's own Docker SMB fixtures are that case. Requiring GUID + share name + volume serial/creation time to all match makes a false merge very unlikely. A false merge is the dangerous direction; failing to merge only costs duplication, like today.
- Failover clusters: they present one GUID across nodes, and merging is correct there.
- Volume identity touches indexing, credentials, and the mount watcher, so this needs a short spec first.
Moved out of #92 (the idle-cost issue) as an edge case of a specific setup.
Activity
docs(perf): SMB alias dedupe moves out of #92 into #335, with the Ser…