[pkg/stanza] - Finalize the design discussion #27359
Replies: 20 comments 2 replies
-
@VihasMakwana, we have gone through many different designs, most of them defined as a difference from a previous attempt. As I mentioned here, I don't understand your most recent design. I think I have gotten lost in all the changes. Perhaps you could put together a design document which describes your design and articulates how it manages to support the current functionality. |
Beta Was this translation helpful? Give feedback.
-
Okay. Makes sense |
Beta Was this translation helpful? Give feedback.
-
Before I attach the design, I would like us to start from scratch and treat it as a new feature. |
Beta Was this translation helpful? Give feedback.
-
@djaglowski talking from the design perspectiv, here's high level overview of my design: A pictorial representation of the beginning of every 2nd stage of the Our thread pool's function: |
Beta Was this translation helpful? Give feedback.
-
The steps per
The steps in the thread pool include:
All of this is done while considering potential race conditions and proper locking is used. |
Beta Was this translation helpful? Give feedback.
-
@VihasMakwana, will you please include a detailed explanation for each of the following:
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
@djaglowski did you get a chance to review the design? |
Beta Was this translation helpful? Give feedback.
-
If your proposal to
This makes no sense to me. What does the I'm asking how your design would asynchronously handle what we currently do with
I need to understand how, in an asynchronous solution, we can safely and correctly determine the most recent offset. Based on later answers, it looks like you're proposing to mutex the entire
What is the point of your proposal if we are not able to get away from this restriction?
All of this misses the following points which I've reiterated multiple times:
In an asynchronous solution, why do we need to rely on batching? Can't we just close one file immediately before opening another? |
Beta Was this translation helpful? Give feedback.
-
If we close them immediately and proceed further, then we won't be able to track moved-away files. |
Beta Was this translation helpful? Give feedback.
-
I think for a complete asynchronous solution, it might be acceptable. Not sure. |
Beta Was this translation helpful? Give feedback.
-
I misunderstood this one, my bad. We also close the file immediately, if we detect a prefix match in |
Beta Was this translation helpful? Give feedback.
-
We close the file after reading, it would result in Next time, if we arrive to same reader , we would have known if we already closed it or not based on r.file
|
Beta Was this translation helpful? Give feedback.
-
That's correct. We use mutex to guarantee thread safety. |
Beta Was this translation helpful? Give feedback.
-
@djaglowski a comment from my other PR explains why I keep this restriction, pasting the same here:
@djaglowski we CAN get rid of this restriction, but I choose not to based on poor performance of benchmarks in extreme cases. However, there's an alternative. We can create another thread pool for lost readers. |
Beta Was this translation helpful? Give feedback.
-
I ran the following function to calculate open file descriptors of the current process with various
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
To understand this, let's consider the following: To discuss the above-mentioned scenario, we remove a reader from The scenario would look something like this with
This means that if a reader is present in Inside the At a particular moment, there can be NO two readers pointing to the same file in |
Beta Was this translation helpful? Give feedback.
-
@djaglowski I saw that your PR got merged and it looks like we have a straightforward situation with open/closed files.
|
Beta Was this translation helpful? Give feedback.
-
@djaglowski ping ^ |
Beta Was this translation helpful? Give feedback.
-
@djaglowski I'm starting this discussion because our previous github issue has lots of people watching and it would spam their mailboxes ;(
So, what I have in mind right now:
Beta Was this translation helpful? Give feedback.
All reactions