-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Make buffers d-tor finalize free #50274
Description
Finally I have sensitive tests for that issue. I will try to untangle this puzzle.
What the problem:
WriteBufferFromS3 write the object. If exceptions occurs the WriteBufferFromS3 instance has to be destroyed and the file is not supposed to be written.
It is wrong to call finalize after an exception. In such cases just trash object will be written and forsaken in S3 or worse**.
Just call destructor without finalize is right. It requires to call finalize manually each time as a commit for the object.
** It is actually Logical Error which triggers terminate() in debug. In release build the exception is muted inside destructor WriteBufferFromFileDecorator.cpp
Priorities:
0 : get rid off of finalize calls in WriteBufferFromFileDecorator and WriteBufferWithFinalizeCallback. That classes are related to S3.
1 : in all write buffers
2 : in read buffers just for symmetry