Skip to content

fix: correct --sender flag and filter list in SSH transfers - #2339

Merged
oferchen merged 1 commit into
masterfrom
fix/ssh-server-mode
Feb 18, 2026
Merged

oferchen merged 1 commit into
masterfrom
fix/ssh-server-mode

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Fix inverted --sender flag in RemoteInvocationBuilder — was added for push instead of pull, causing both sides to enter receiver mode and deadlock
  • Remove premature filter list send from run_pull_transfer — was sent before protocol handshake
  • Set client_mode = true for both push and pull SSH transfers so filters are sent at the correct protocol point (after handshake + compat exchange)
  • Remove dead send_filter_list_to_server function

Root cause: Two bugs introduced when SSH support was first implemented. The --sender flag logic was opposite to upstream options.c:2598 (if (!am_sender) args[ac++] = "--sender"), and the filter list was sent before the handshake instead of after.

Test plan

  • All 21,724 workspace tests pass
  • SSH pull: 10K files transferred successfully in container
  • SSH push: 10K files transferred successfully in container
  • SSH benchmark vs upstream: upstream 1.35x faster (1.225s vs 1.656s)

Two bugs prevented SSH transfers from working:

1. The --sender flag was inverted in RemoteInvocationBuilder: it was
   added for push (local=sender) instead of pull (local=receiver).
   Upstream options.c:2598: `if (!am_sender) args[ac++] = "--sender"`.

2. run_pull_transfer sent the filter list before the protocol handshake,
   causing a deadlock. Now both pull and push set client_mode=true so
   the server flow sends filters at the correct point (after handshake
   + compat exchange), matching upstream main.c:1258.

Removes the now-unused send_filter_list_to_server function and
ProtocolVersion/write_filter_list imports.
@oferchen
oferchen merged commit ce49915 into master Feb 18, 2026
30 checks passed
@oferchen
oferchen deleted the fix/ssh-server-mode branch February 18, 2026 15:04
@oferchen oferchen added the bug Something isn't working label Feb 19, 2026
oferchen added a commit that referenced this pull request May 1, 2026
Two bugs prevented SSH transfers from working:

1. The --sender flag was inverted in RemoteInvocationBuilder: it was
   added for push (local=sender) instead of pull (local=receiver).
   Upstream options.c:2598: `if (!am_sender) args[ac++] = "--sender"`.

2. run_pull_transfer sent the filter list before the protocol handshake,
   causing a deadlock. Now both pull and push set client_mode=true so
   the server flow sends filters at the correct point (after handshake
   + compat exchange), matching upstream main.c:1258.

Removes the now-unused send_filter_list_to_server function and
ProtocolVersion/write_filter_list imports.
oferchen added a commit that referenced this pull request May 5, 2026
Two bugs prevented SSH transfers from working:

1. The --sender flag was inverted in RemoteInvocationBuilder: it was
   added for push (local=sender) instead of pull (local=receiver).
   Upstream options.c:2598: `if (!am_sender) args[ac++] = "--sender"`.

2. run_pull_transfer sent the filter list before the protocol handshake,
   causing a deadlock. Now both pull and push set client_mode=true so
   the server flow sends filters at the correct point (after handshake
   + compat exchange), matching upstream main.c:1258.

Removes the now-unused send_filter_list_to_server function and
ProtocolVersion/write_filter_list imports.
oferchen added a commit that referenced this pull request May 18, 2026
…#2339)

The `SpillGranularity` knob on `SpillPolicy` was a forward-compat stub.
This change makes `SpillableReorderBuffer` honour the field at write
time and wires it through `ConcurrentDeltaConfig` so callers can
actually pick a strategy:

- `WholeBatch` (default): one length-prefixed record per spill event
  holds every non-hot-zone candidate concatenated. The 4-byte header is
  paid once per event instead of once per item, and reload decodes the
  whole record and refills the in-memory ring.
- `PerItem`: keeps the historical layout of one record per item, so a
  single reload only has to decode one payload.

`spill_index` keeps mapping sequence -> record offset for both flavours.
A new `batch_members` map records the encode-order sibling sequences
for whole-batch records so partial evictions survive without corrupting
decode order; per-item records skip the map entirely.

Three new unit tests cover the contract: `granularity_whole_batch_writes_single_chunk`
asserts on-disk size equals `header_bytes + payload_bytes` with a single
header per event; `granularity_per_item_writes_n_chunks` asserts the
per-item layout pays one header per item; `granularity_per_item_round_trip_byte_identical`
plus a matching whole-batch test pin payload integrity across both
formats.

Closes #2339.
oferchen added a commit that referenced this pull request May 18, 2026
…#2339)

The `SpillGranularity` knob on `SpillPolicy` was a forward-compat stub.
This change makes `SpillableReorderBuffer` honour the field at write
time and wires it through `ConcurrentDeltaConfig` so callers can
actually pick a strategy:

- `WholeBatch` (default): one length-prefixed record per spill event
  holds every non-hot-zone candidate concatenated. The 4-byte header is
  paid once per event instead of once per item, and reload decodes the
  whole record and refills the in-memory ring.
- `PerItem`: keeps the historical layout of one record per item, so a
  single reload only has to decode one payload.

`spill_index` keeps mapping sequence -> record offset for both flavours.
A new `batch_members` map records the encode-order sibling sequences
for whole-batch records so partial evictions survive without corrupting
decode order; per-item records skip the map entirely.

Three new unit tests cover the contract: `granularity_whole_batch_writes_single_chunk`
asserts on-disk size equals `header_bytes + payload_bytes` with a single
header per event; `granularity_per_item_writes_n_chunks` asserts the
per-item layout pays one header per item; `granularity_per_item_round_trip_byte_identical`
plus a matching whole-batch test pin payload integrity across both
formats.

Closes #2339.
oferchen added a commit that referenced this pull request May 18, 2026
…#2339) (#4428)

The `SpillGranularity` knob on `SpillPolicy` was a forward-compat stub.
This change makes `SpillableReorderBuffer` honour the field at write
time and wires it through `ConcurrentDeltaConfig` so callers can
actually pick a strategy:

- `WholeBatch` (default): one length-prefixed record per spill event
  holds every non-hot-zone candidate concatenated. The 4-byte header is
  paid once per event instead of once per item, and reload decodes the
  whole record and refills the in-memory ring.
- `PerItem`: keeps the historical layout of one record per item, so a
  single reload only has to decode one payload.

`spill_index` keeps mapping sequence -> record offset for both flavours.
A new `batch_members` map records the encode-order sibling sequences
for whole-batch records so partial evictions survive without corrupting
decode order; per-item records skip the map entirely.

Three new unit tests cover the contract: `granularity_whole_batch_writes_single_chunk`
asserts on-disk size equals `header_bytes + payload_bytes` with a single
header per event; `granularity_per_item_writes_n_chunks` asserts the
per-item layout pays one header per item; `granularity_per_item_round_trip_byte_identical`
plus a matching whole-batch test pin payload integrity across both
formats.

Closes #2339.
oferchen added a commit that referenced this pull request May 18, 2026
…#2339) (#4428)

The `SpillGranularity` knob on `SpillPolicy` was a forward-compat stub.
This change makes `SpillableReorderBuffer` honour the field at write
time and wires it through `ConcurrentDeltaConfig` so callers can
actually pick a strategy:

- `WholeBatch` (default): one length-prefixed record per spill event
  holds every non-hot-zone candidate concatenated. The 4-byte header is
  paid once per event instead of once per item, and reload decodes the
  whole record and refills the in-memory ring.
- `PerItem`: keeps the historical layout of one record per item, so a
  single reload only has to decode one payload.

`spill_index` keeps mapping sequence -> record offset for both flavours.
A new `batch_members` map records the encode-order sibling sequences
for whole-batch records so partial evictions survive without corrupting
decode order; per-item records skip the map entirely.

Three new unit tests cover the contract: `granularity_whole_batch_writes_single_chunk`
asserts on-disk size equals `header_bytes + payload_bytes` with a single
header per event; `granularity_per_item_writes_n_chunks` asserts the
per-item layout pays one header per item; `granularity_per_item_round_trip_byte_identical`
plus a matching whole-batch test pin payload integrity across both
formats.

Closes #2339.
oferchen added a commit that referenced this pull request May 18, 2026
…#2339) (#4428)

The `SpillGranularity` knob on `SpillPolicy` was a forward-compat stub.
This change makes `SpillableReorderBuffer` honour the field at write
time and wires it through `ConcurrentDeltaConfig` so callers can
actually pick a strategy:

- `WholeBatch` (default): one length-prefixed record per spill event
  holds every non-hot-zone candidate concatenated. The 4-byte header is
  paid once per event instead of once per item, and reload decodes the
  whole record and refills the in-memory ring.
- `PerItem`: keeps the historical layout of one record per item, so a
  single reload only has to decode one payload.

`spill_index` keeps mapping sequence -> record offset for both flavours.
A new `batch_members` map records the encode-order sibling sequences
for whole-batch records so partial evictions survive without corrupting
decode order; per-item records skip the map entirely.

Three new unit tests cover the contract: `granularity_whole_batch_writes_single_chunk`
asserts on-disk size equals `header_bytes + payload_bytes` with a single
header per event; `granularity_per_item_writes_n_chunks` asserts the
per-item layout pays one header per item; `granularity_per_item_round_trip_byte_identical`
plus a matching whole-batch test pin payload integrity across both
formats.

Closes #2339.
oferchen added a commit that referenced this pull request Aug 24, 2026
…#2339) (#4428)

The `SpillGranularity` knob on `SpillPolicy` was a forward-compat stub.
This change makes `SpillableReorderBuffer` honour the field at write
time and wires it through `ConcurrentDeltaConfig` so callers can
actually pick a strategy:

- `WholeBatch` (default): one length-prefixed record per spill event
  holds every non-hot-zone candidate concatenated. The 4-byte header is
  paid once per event instead of once per item, and reload decodes the
  whole record and refills the in-memory ring.
- `PerItem`: keeps the historical layout of one record per item, so a
  single reload only has to decode one payload.

`spill_index` keeps mapping sequence -> record offset for both flavours.
A new `batch_members` map records the encode-order sibling sequences
for whole-batch records so partial evictions survive without corrupting
decode order; per-item records skip the map entirely.

Three new unit tests cover the contract: `granularity_whole_batch_writes_single_chunk`
asserts on-disk size equals `header_bytes + payload_bytes` with a single
header per event; `granularity_per_item_writes_n_chunks` asserts the
per-item layout pays one header per item; `granularity_per_item_round_trip_byte_identical`
plus a matching whole-batch test pin payload integrity across both
formats.

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant