microsoft / microsoft/rDSN

aio write imcompletely bug

Open
#196 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
970
Forks
213
Avg merge
2d 16h
Merged PRs (30d)
1

Description

core dump:

F10:16:40.459 (1480990600459595051 156a) replica.io-thrd.05482: assertion expression: size >= this_size
F10:16:40.459 (1480990600459612035 156a) replica.io-thrd.05482: written buffer size does not equal to input buffer's size: 5256 vs 11448

source code:

aio_task* disk_file::on_write_completed(aio_task* wk, void* ctx, error_code err, size_t size)
{
    auto ret = _write_queue.on_work_completed(wk, ctx);
    
    while (wk)
    {
        aio_task* next = (aio_task*)wk->next;
        wk->next = nullptr;

        if (err == ERR_OK)
        {
            size_t this_size = (size_t)wk->aio()->buffer_size;
            dassert(size >= this_size, 
                "written buffer size does not equal to input buffer's size: %d vs %d",
                (int)size,
                (int)this_size
                );

            wk->enqueue(err, this_size);
            size -= this_size;
        }

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at disk_file::on_write_completed and inspect the _write_queue completion path around the reported assertion. Use the core dump values, 5256 versus 11448, to reproduce or explain the mismatch; done means the async write completion path no longer triggers the reported failure and the behavior is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.