RFC: Add MemoryTrackerFaultInjectorInThread#43337
RFC: Add MemoryTrackerFaultInjectorInThread#43337azat wants to merge 1 commit intoClickHouse:masterfrom
Conversation
Signed-off-by: Azat Khuzhin <[email protected]>
ff915fe to
faa382b
Compare
|
Failures (well, of course they don't, since this code is not even used) are not related:
Real OOM
Looks like slow parts removal
|
|
|
||
| std::bernoulli_distribution fault(fault_probability); | ||
| if (unlikely(fault_probability > 0.0 && fault(thread_local_rng))) | ||
| if (unlikely(fault_probability > 0.0 && fault(thread_local_rng) || MemoryTrackerFaultInjectorInThread::faulty())) |
There was a problem hiding this comment.
Just small optimization. I guess it should also be inside unlikely
There was a problem hiding this comment.
It is already inside unlikely.
But TBH, I would consider this an optimization for reader, in other words to make it more obvious what is the regular code path for reader, not for processor, since it is not that hot place.
serxa
left a comment
There was a problem hiding this comment.
It's usefulness is not clear w/o that setting you are talking about. Maybe add at least one good place and a setting itself to this PR?
|
Just a few words about this patch, it had been submitted only to "document" what I was referenced in another PR, posted with an RFC tag, maybe needed something similar to test other peaces of code. And thinking about it a little bit more, and I don't think that it is interesting in it's current form, so I'm going to close it.
Something like But anyway I don't think that this is interesting in this way, since first you need to add it into some places, while I don't think that it is a good idea in general What can work, is patching the code on fly. |
Changelog category (leave one):
This is an injector that can catch some problems (maybe it worth add it to some major places and enable under some setting?).