-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Enhancement] WriteAheadLog with sequentially callback #1718
Comments
@superhx Hey, after careful consideration of the current write model on my end, I've found that to retain the current parallel write model while implementing sequential callback semantics on top, After the block is written to the WAL, consider serializing the process of writing the record to the logCache to reduce the complexity at the upper layer.
for example: This approach can avoid concurrency control of the callbackSequencer, while also decoupling business-related operations from I/O operations: since the current I/O thread is not only responsible for writing the block but also for handling the request callback processing chain; Potential issues: Considering under a large number of requests, processing callbacks may lead to significant processing pressure, but for now, they are all pure memory operations. If there is concern about delays in ack responses, then it is actually possible to consider designing the callbackExecutor as a multi-threaded model, routing to threads in the object thread pool based on streamId,thereby ensuring the orderliness maintained by the stream. |
@CLFutureX Hi, I think you might have misunderstood @superhx's idea. In his description,
the "upper layer" mentioned here refers to Specifically, you can see that due to the current non-sequentially callback, we have added a lot of complex logic in What we want to do now is to thoroughly refactor |
Ye, this will be a big project |
@superhx @Chillax-0v0 Design for Ordered Return with Concurrent WritingExpectations:
Plan Design:
BlockContinuing the current block design, it remains unchanged externally, but internally builds logical partitions, routing to different blockPartitions through streamid, thus achieving imperceptible to the outside. Based on partition distribution: Calculation of blockPartition's startOffset: How to calculate it? eventloopGroupParallel Writing: IO threadFree IOPS Limit: The benefits of the plan include:● Achieved orderly writing based on partitioning. |
Problem
Currently, BlockWALService persists data blocks in parallel, responding directly to the upper layer with success as soon as any data block is persisted, even if the previous data block has not completed persistence. Although this method provides "better" write latency, it shifts the responsibility of ensuring sequentiality to the upper layer, making the upper layer logic more complex.
Expectation
Implement a
SequetialBlockWALService
:BlockWALService
on Aliyun ESSD PL1 20GB 120MiB/s 2800 IOPS with write concurrency 8/16/32/64;BlockWALService
so that it can be directly replaced in the future;The text was updated successfully, but these errors were encountered: