feat: ec module#72
Conversation
longhorn/longhorn-1061 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
…ble fields longhorn/longhorn-1061 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
…queue longhorn/longhorn-1061 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
…gments longhorn/longhorn-1061 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
…d bit clear longhorn/longhorn-1061 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
… counters longhorn/longhorn-1061 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-1061 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
1fc7dfd to
9491893
Compare
c097726 to
82ddb16
Compare
| * the JSON-RPC response once WIB load completes. | ||
| */ | ||
| } | ||
| SPDK_RPC_REGISTER("bdev_ec_create", rpc_bdev_ec_create, SPDK_RPC_RUNTIME) |
There was a problem hiding this comment.
IMO, this is legitimate but low priority for this PR deliverable. Longhorn doesn't read schema/schema.json, impact zero. Can defer to later and improve on request.
94ab6a1 to
744e8f0
Compare
| slot_lba_blocks = ec_bitmap_slot_lba_blocks(ec, ctx->next_copy); | ||
|
|
||
| ec->bitmap_persist_pending = true; | ||
|
|
||
| for (i = 0; i < ec->n; i++) { | ||
| if (!ec->descs[i] || !ec->bitmap_chans[i] || | ||
| !ec_slot_is_writable(ec, i)) { | ||
| continue; | ||
| } | ||
|
|
||
| ctx->writes_in_flight++; | ||
| rc = spdk_bdev_write(ec->descs[i], | ||
| ec->bitmap_chans[i], | ||
| ctx->dma_buf, | ||
| slot_lba_blocks * ec->bdev.blocklen, | ||
| slot_size_bytes, | ||
| ec_bitmap_persist_write_cb, | ||
| ctx); | ||
| if (rc != 0) { | ||
| SPDK_WARNLOG("EC bdev %s: bitmap persist submit failed " | ||
| "for slot %u (rc=%d)\n", | ||
| ec->bdev.name, i, rc); | ||
| ctx->writes_in_flight--; |
There was a problem hiding this comment.
The suggested fix seems under-evaluated (potentially might break the bitmap's single-writer on-disk model). Went with marshalling + home-thread assertion.
There was a problem hiding this comment.
I've also under-evaluated. Since Longhorn V2 RAID1 mode supports multi-reactor, marshalling + home-thread assertions are not a good fit, either (1) all write requests would need to be marshalled back to the home-thread, or (2) write requests would get dropped due to home-thread assertions in the multi-reactor case. Neither is safe/scalable approach.
Planning for multi-reactor support.
There was a problem hiding this comment.
PoC with a similar approach to the blobstore md_thread pattern.
c4e0838 to
78af565
Compare
| * For now the assert lands here: under multi-reactor it aborts at the | ||
| * exact spot the follow-up needs to land. Single-reactor is unaffected. | ||
| */ | ||
| assert(spdk_get_thread() == ec->home_thread); |
| * For now the assert lands here: under multi-reactor it aborts at | ||
| * the exact spot the follow-up needs to land. Single-reactor is | ||
| * unaffected. | ||
| */ | ||
| assert(spdk_get_thread() == ec->home_thread); |
| * For now the assert lands here: under multi-reactor it aborts at | ||
| * the exact spot the follow-up needs to land. Single-reactor is | ||
| * unaffected. | ||
| */ | ||
| assert(spdk_get_thread() == ec->home_thread); |
| * The WIB protects against the RMW write-hole. One dirty bit per | ||
| * region of EC_WIB_REGION_STRIPES stripes, stored on-disk as two | ||
| * alternating copies in the last two strips of every parity disk. |
| * Protects against the RMW write-hole. One dirty bit per region of | ||
| * EC_WIB_REGION_STRIPES stripes, stored on-disk as two alternating | ||
| * copies in the last two strips of every parity disk. See | ||
| * bdev_ec_wib.c for the on-disk layout and persist protocol. |
| if (spdk_likely(owner == spdk_get_thread())) { | ||
| ec_write_into_unmapped_finalize(ec_io); | ||
| } else { | ||
| spdk_thread_send_msg(owner, ec_write_into_unmapped_finalize, ec_io); |
Which issue(s) this PR fixes:
Issue longhorn/longhorn#1061
What this PR does / why we need it:
Implement EC module.
Special notes for your reviewer:
NoneAdditional documentation or context
None