ltfs icon indicating copy to clipboard operation
ltfs copied to clipboard

Enhancement for creating pretty extent at flush

Open piste-jp opened this issue 5 years ago • 3 comments

Summary of changes

Change the implementation of flush() request to enqueue the remaining blocks to the writer queue. And make them processed sequentially.

Description

Previously, our flush operation might flip the final block when we get a small time window below.

  1. LTFS receives a write and the unified scheduler completes one block and send it to the Q
  2. LTFS receives another write
  3. LTFS receives a flush
  4. LTFS processes the block created in step2 within flush operation (because previous flush stops the writer thread and write blocks directly)
  5. The writer thread wake up because of step1 and process the block queued in step1

In this change, all blocks are queued in flush operation and shall be processed by writer thread.

  • Do not wait the writer thread processes the queued block when flush is called against individual files
  • Wait the writer thread processes the queued block when flush is called against all files (like periodical sync request)

I believe this strategy improves the LTFS performance in normal condition (little bit make LTFS danger but enough safe, I believe). And LTFS makes a pretty extent in any time.

Type of change

  • Enhancement with long term test

Checklist:

  • [X] My code follows the style guidelines of this project
  • [X] I have performed a self-review of my own code
  • [X] I have commented my code, particularly in hard-to-understand areas
  • [X] I have made corresponding changes to the documentation
  • [X] My changes generate no new warnings
  • [X] I have confirmed my fix is effective or that my feature works

piste-jp avatar Sep 11 '20 06:09 piste-jp

@piste-jp-ibm, I'm now looking into reproducing the original behavior. Would you know if the file with the flipped extent needs to be a candidate for writing to the Index Partition? Also, I'm wondering if the periodic sync thread may be playing a role here..

lucasvr avatar Sep 22 '20 20:09 lucasvr

@lucasvr

It's a good point. The answer is yes. But I believe size of placement rules are small, like 1MiB, in most cases. So I can't see any problem around here.

But from logic point of view, we need to tape care about this.

piste-jp avatar Sep 22 '20 22:09 piste-jp

That's really good to know, thanks! I will take a closer look at the interactions between the queues so I can understand the conditions which can lead to flipped extent entries.

lucasvr avatar Sep 23 '20 01:09 lucasvr