1.1 KiB
1.1 KiB
SQ-010: Publish Endpoint (Single Node)
Status: [x] DONE
Blocked by: SQ-007, SQ-009
Priority: High
Description
Implement the Publish gRPC RPC. Clients send messages which are durably written to the local WAL via StorageEngine.
Files to Create/Modify
crates/sq-server/src/grpc/data_plane.rs- DataPlaneService Publish implcrates/sq-server/src/state.rs- add StorageEngine to State
Behavior
- Receive PublishRequest with batch of messages
- For each message: call StorageEngine::append
- Ack mode handling:
- ACK_MODE_ALL: return after fsync (default single-node behavior)
- ACK_MODE_LOCAL: same as ALL for single node
- ACK_MODE_NONE: return immediately, write async
- Return PublishResponse with offset assignments
Acceptance Criteria
- Publish 1 message, verify WAL file exists and contains the message
- Publish batch of 100 messages, verify all acked with sequential offsets
- ACK_MODE_NONE: response is immediate (no waiting for fsync)
- Invalid request (empty topic): returns InvalidArgument gRPC status
- Auto-create topic on first publish (if topic doesn't exist)