edubraqd opened a new pull request, #24949:
URL: https://github.com/apache/datafusion/pull/24949

   ## Which issue does this PR close?
   
   - N/A (found while fuzzing configuration values; happy to open one if 
preferred).
   
   ## Rationale for this change
   
   `datafusion.execution.objectstore_writer_buffer_size` accepted `0`, and 
every object store write then hung: `BufWriter::with_capacity(_, _, 0)` 
switches to a multipart upload with a chunk size of 0, and `object_store`'s 
`WriteMultipart::put` splits off zero bytes in a loop without ever consuming 
its input.
   
   ```sql
   SET datafusion.execution.objectstore_writer_buffer_size = 0;
   COPY (SELECT 1) TO 'x.parquet';   -- never returns
   ```
   
   ## What changes are included in this PR?
   
   The option becomes a `ConfigNonZeroUsize`, like 
`datafusion.execution.batch_size` and `datafusion.sql_parser.recursion_limit`, 
so `SET ... = 0` fails with `value must be greater than 0`. The seven call 
sites read it with `.get()`, and the option's description (docs and 
`information_schema`) notes the constraint. (The zero-chunk loop in 
`object_store` is worth a separate report there; this change keeps DataFusion 
from reaching it.)
   
   ## Are these changes tested?
   
   Yes. `test_objectstore_writer_buffer_size_must_be_positive` checks that a 
positive value is accepted and `0` is rejected at `SET` time. `copy.slt` and 
`information_schema.slt` pass (the default is still `10485760`).
   
   ## Are there any user-facing changes?
   
   Setting `objectstore_writer_buffer_size` to `0` is now a configuration 
error. The field's Rust type changes from `usize` to `ConfigNonZeroUsize`, the 
same change `batch_size` went through.
   


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to