xue-ding-e commented on issue #4452:
URL: https://github.com/apache/iggy/issues/4452#issuecomment-6120299710

   AI-assisted source analysis (OpenAI); no implementation or runtime tests yet.
   
   Could the idempotent creation work start with a stream-only slice? I could 
prepare `stream create --if-not-exists` after the scope is agreed and assigned:
   
   - Keep the current strict behavior unless the flag is supplied. Submit the 
create request directly and treat only the duplicate-stream-name result as 
success, avoiding a read-before-create race.
   - Ensure the exact, case-sensitive stream name exists while preserving its 
existing ID and options. This would not reconcile configuration. The CLI 
creation command currently takes only a name; its legacy `--stream-id` is 
already ignored.
   - Binary transports expose `StreamNameAlreadyExists` (1012). HTTP currently 
wraps the structured server error in `HttpResponseError`, so HTTP support must 
recognize that exact error id/code rather than treating a generic 400 as 
success. Unrelated failures must still propagate.
   - Cover first and repeated creation, preservation of existing state, strict 
mode, case-distinct and numeric-looking names, unrelated failures across 
transports, and CLI help. Any test lookup of a numeric-looking name must use 
`Identifier::named` rather than interpreting it as an ID.
   
   NATS provides a useful comparison: its JetStream `CreateStream` accepts an 
existing stream with the same configuration. The narrower Iggy proposal here 
would mean “ensure this name exists”, with no implied configuration update. 
Conditional deletion, other resources, prompts and exit-code changes could 
remain separate.
   
   Is that scope and error-classification approach acceptable, and is anyone 
already working on it?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to