#53570·milvus

[Enhancement]: Share primary key extraction between WAL interceptors

Author: bigsheeperCreated Sep 17, 2026Updated Sep 17, 2026
Labelskind/enhancement

Is there an existing issue for this?

  • I have searched the existing issues

What would you like to be added?

The code that extracts primary keys from WAL insert and delete messages lives inside the partial-update interceptor (internal/streamingnode/server/wal/interceptors/partialupdate). It is unexported and tied to that package's private key type.

Proposal: move the generic part out, in three pieces, and make the partial-update interceptor call them. CAS scope derivation and fence handling stay in partialupdate.

  • message: a cancellable, error-returning DecodeBody(ctx) on the specialized messages, next to Body() which panics when an encrypted payload can not be decrypted.
  • wal/utility: decoding an insert or delete body on the append path, with the failure classified as a streaming status.
  • wal/utility/primarykey: a columnar Keys batch and KeysOfInsert / KeysOfInsertDeclared / KeysOfInsertField / KeysOfDelete, the strict validation of the primary key payload of a write.

Error codes stay unchanged. The texts of the moved checks lose the words "partial update", because the checks are no longer specific to that interceptor; a test pins the codes and texts reachable from the partial-update entry points.

Why is this needed?

The write path of the LSM-based primary key index (#52305) needs the same decoding, with the same schema checks, in another WAL interceptor. Copying it would let the two copies drift apart in validation and error handling.

Anything else?

Part of #52305