From 0b95fd262e698e27d242331ab0cf30e4b49d36eb Mon Sep 17 00:00:00 2001 From: satbir Date: Thu, 27 Sep 2018 12:43:03 +0530 Subject: [PATCH 1/5] Flush outstanding IOs before taking snapshot on rebuild clone. Signed-off-by: satbir --- cmd/uzfs_test/zrepl_utest.c | 83 ++++++++++++++++++++++++++++++++- include/sys/uzfs_zvol.h | 2 + include/zrepl_mgmt.h | 6 +++ include/zrepl_prot.h | 1 + lib/libzrepl/data_conn.c | 55 +++++++++++++++++++--- lib/libzrepl/mgmt_conn.c | 2 + tests/cbtest/gtest/test_uzfs.cc | 8 ++++ 7 files changed, 148 insertions(+), 9 deletions(-) diff --git a/cmd/uzfs_test/zrepl_utest.c b/cmd/uzfs_test/zrepl_utest.c index 9188595ab1fc..3c6e5e01c412 100644 --- a/cmd/uzfs_test/zrepl_utest.c +++ b/cmd/uzfs_test/zrepl_utest.c @@ -295,6 +295,53 @@ zrepl_utest_replica_rebuild_start(int fd, mgmt_ack_t *mgmt_ack, return (0); } +static int +zrepl_send_read(int sfd, uint64_t io_block_size) +{ + + char *buf; + int count; + zvol_io_hdr_t hdr; + struct zvol_io_rw_hdr read_hdr; + + hdr.version = REPLICA_VERSION; + hdr.opcode = ZVOL_OPCODE_READ; + hdr.io_seq = 0; + hdr.len = io_block_size; + hdr.status = 0; + hdr.flags = 0; + hdr.offset = 0; + + count = write(sfd, (void *)&hdr, sizeof (hdr)); + if (count == -1) { + printf("Write error\n"); + return (-1); + } + + count = read(sfd, (void *)&hdr, sizeof (hdr)); + if (count == -1) { + printf("header read failed\n"); + return (-1); + } + + if (hdr.opcode == ZVOL_OPCODE_READ) { + count = read(sfd, &read_hdr, sizeof (read_hdr)); + if (count != sizeof (read_hdr)) { + printf("Meta data header read error\n"); + return (-1); + } + + buf = kmem_alloc(read_hdr.len, KM_SLEEP); + count = read(sfd, buf, read_hdr.len); + free(buf); + if (count == -1) { + printf("payload read failed\n"); + return (-1); + } + } + return (0); +} + static void reader_thread(void *arg) { @@ -1026,7 +1073,7 @@ zrepl_rebuild_test(void *arg) goto exit; } /* - * Check rebuild status of of downgrade replica ds1. + * Check rebuild status of downgrade replica ds1. */ status_check: count = zrepl_utest_get_replica_status(ds1, ds1_mgmt_fd, &status_ack); @@ -1034,6 +1081,14 @@ zrepl_rebuild_test(void *arg) goto exit; } + /* Send a dummy IO to ds1 so that IO_quiesce check move on */ + if (status_ack.rebuild_status == ZVOL_REBUILDING_AFS) { + sleep(1); + if (zrepl_send_read(ds1_io_sfd, io_block_size) == -1) + goto exit; + goto status_check; + } + if (status_ack.state != ZVOL_STATUS_HEALTHY) { sleep(1); goto status_check; @@ -1101,6 +1156,14 @@ zrepl_rebuild_test(void *arg) goto exit; } + /* Send a dummy IO to ds2 so that IO_quiesce check move on */ + if (status_ack.rebuild_status == ZVOL_REBUILDING_AFS) { + sleep(1); + if (zrepl_send_read(ds2_io_sfd, io_block_size) == -1) + goto exit; + goto status_check1; + } + if (status_ack.state != ZVOL_STATUS_HEALTHY) { sleep(1); goto status_check1; @@ -1170,6 +1233,14 @@ zrepl_rebuild_test(void *arg) goto exit; } + /* Send a dummy IO to ds3 so that IO_quiesce check move on */ + if (status_ack.rebuild_status == ZVOL_REBUILDING_AFS) { + sleep(1); + if (zrepl_send_read(ds3_io_sfd, io_block_size) == -1) + goto exit; + goto status_check2; + } + if (status_ack.rebuild_status != ZVOL_REBUILDING_FAILED) { sleep(1); goto status_check2; @@ -1195,7 +1266,7 @@ zrepl_rebuild_test(void *arg) /* * Start rebuild process on downgraded replica ds3 - * by sharing IP and rebuild_Port info with ds3. + * by sharing IP and rebuild_port info with ds3. */ rc = zrepl_utest_replica_rebuild_start(ds3_mgmt_fd, mgmt_ack_ds3, sizeof (mgmt_ack_t) * 3); @@ -1211,6 +1282,14 @@ zrepl_rebuild_test(void *arg) goto exit; } + /* Send a dummy IO to ds3 so that IO_quiesce check move on */ + if (status_ack.rebuild_status == ZVOL_REBUILDING_AFS) { + sleep(1); + if (zrepl_send_read(ds3_io_sfd, io_block_size) == -1) + goto exit; + goto status_check3; + } + if (status_ack.state != ZVOL_STATUS_HEALTHY) { sleep(1); goto status_check3; diff --git a/include/sys/uzfs_zvol.h b/include/sys/uzfs_zvol.h index 1bf6f7e2e2d8..d7e65ed8cae6 100644 --- a/include/sys/uzfs_zvol.h +++ b/include/sys/uzfs_zvol.h @@ -98,6 +98,8 @@ typedef struct zvol_state zvol_state_t; #define ZVOL_IS_REBUILDING(zv) \ ((zv->rebuild_info.zv_rebuild_status == ZVOL_REBUILDING_SNAP) || \ (zv->rebuild_info.zv_rebuild_status == ZVOL_REBUILDING_AFS)) +#define ZVOL_IS_REBUILDING_AFS(zv) \ + (zv->rebuild_info.zv_rebuild_status == ZVOL_REBUILDING_AFS) #define ZVOL_IS_REBUILDED(zv) \ (zv->rebuild_info.zv_rebuild_status == ZVOL_REBUILDING_DONE) #define ZVOL_IS_REBUILDING_ERRORED(zv) \ diff --git a/include/zrepl_mgmt.h b/include/zrepl_mgmt.h index 342852744200..5df4c7394fd3 100644 --- a/include/zrepl_mgmt.h +++ b/include/zrepl_mgmt.h @@ -73,6 +73,7 @@ typedef struct inject_delay_s { int helping_replica_rebuild_step; int pre_uzfs_write_data; int downgraded_replica_rebuild_size_set; + int rebuid_io_quiesce_check_by_pass; } inject_delay_t; typedef struct inject_error_s { @@ -158,6 +159,11 @@ typedef struct zvol_info_s { /* Will be used to singal ack-sender to exit */ uint8_t conn_closed; + + /* Rebuild flags to quiesce IOs */ + uint8_t quiesce_requested; + uint8_t quiesce_done; + /* Pointer to mgmt connection for this zinfo */ void *mgmt_conn; diff --git a/include/zrepl_prot.h b/include/zrepl_prot.h index fe6b3b0ee183..dbe5137136e5 100644 --- a/include/zrepl_prot.h +++ b/include/zrepl_prot.h @@ -169,6 +169,7 @@ enum zvol_status { typedef enum zvol_status zvol_status_t; +#define ZVOL_IS_HEALTHY(zv) (zv->zv_status == ZVOL_STATUS_HEALTHY) struct zrepl_status_ack { zvol_status_t state; zvol_rebuild_status_t rebuild_status; diff --git a/lib/libzrepl/data_conn.c b/lib/libzrepl/data_conn.c index bfb54183c486..b8caf0bf8f7e 100644 --- a/lib/libzrepl/data_conn.c +++ b/lib/libzrepl/data_conn.c @@ -228,14 +228,21 @@ uzfs_submit_writes(zvol_info_t *zinfo, zvol_io_cmd_t *zio_cmd) remain -= sizeof (*write_hdr); if (remain < write_hdr->len) return (-1); - - rc = uzfs_write_data(zinfo->main_zv, datap, data_offset, - write_hdr->len, &metadata, is_rebuild); - if (rc != 0) - break; + /* + * Write to main_zv when volume is either + * healthy or in REBUILD_AFS state of rebuild + */ + if (ZVOL_IS_REBUILDING_AFS(zinfo->main_zv) || + ZVOL_IS_HEALTHY(zinfo->main_zv)) { + rc = uzfs_write_data(zinfo->main_zv, datap, data_offset, + write_hdr->len, &metadata, is_rebuild); + if (rc != 0) + break; + } /* IO to clone should be sent only when it is from app */ - if (!is_rebuild && (zinfo->clone_zv != NULL)) { + if (!is_rebuild && !ZVOL_IS_HEALTHY(zinfo->main_zv) && + (zinfo->clone_zv != NULL)) { rc = uzfs_write_data(zinfo->clone_zv, datap, data_offset, write_hdr->len, &metadata, is_rebuild); @@ -670,10 +677,31 @@ uzfs_zvol_rebuild_dw_replica(void *arg) * one of them might have changed rebuild state */ if (uzfs_zvol_get_rebuild_status(zinfo->main_zv) != - ZVOL_REBUILDING_AFS) + ZVOL_REBUILDING_AFS) { uzfs_zvol_set_rebuild_status(zinfo->main_zv, ZVOL_REBUILDING_AFS); + /* + * Lets ask io_receiver thread to flush + * all outstanding IOs in taskq + */ + zinfo->quiesce_done = 0; + zinfo->quiesce_requested = 1; + } mutex_exit(&zinfo->main_zv->rebuild_mtx); + /* + * Wait for all outstanding IOs to be flushed + * to disk before making further progress + */ +#ifdef DEBUG + if (inject_error.delay.rebuid_io_quiesce_check_by_pass) + continue; +#endif + while (1) { + if (!zinfo->quiesce_done) + sleep(1); + else + break; + } continue; } ASSERT((hdr.opcode == ZVOL_OPCODE_READ) && @@ -1828,6 +1856,19 @@ uzfs_zvol_io_receiver(void *arg) /* Take refcount for uzfs_zvol_worker to work on it */ uzfs_zinfo_take_refcnt(zinfo); zio_cmd->zinfo = zinfo; + + /* + * Rebuild want to take consistent snapshot + * so it asked to flush all outstanding IOs + * before taking snapshot on rebuild_clone + */ + if (zinfo->quiesce_requested) { + ASSERT(ZVOL_IS_REBUILDING_AFS(zinfo->main_zv)); + taskq_wait_outstanding(zinfo->uzfs_zvol_taskq, 0); + zinfo->quiesce_requested = 0; + zinfo->quiesce_done = 1; + } + taskq_dispatch(zinfo->uzfs_zvol_taskq, uzfs_zvol_worker, zio_cmd, TQ_SLEEP); } diff --git a/lib/libzrepl/mgmt_conn.c b/lib/libzrepl/mgmt_conn.c index dc25b50ecbbf..acaed6126697 100644 --- a/lib/libzrepl/mgmt_conn.c +++ b/lib/libzrepl/mgmt_conn.c @@ -1230,10 +1230,12 @@ handle_start_rebuild_req(uzfs_mgmt_conn_t *conn, zvol_io_hdr_t *hdrp, memset(&zinfo->main_zv->rebuild_info, 0, sizeof (zvol_rebuild_info_t)); +#if 0 if (zinfo->checkpointed_ionum >= max_ioseq) uzfs_zvol_set_rebuild_status(zinfo->main_zv, ZVOL_REBUILDING_AFS); else +#endif uzfs_zvol_set_rebuild_status(zinfo->main_zv, ZVOL_REBUILDING_SNAP); diff --git a/tests/cbtest/gtest/test_uzfs.cc b/tests/cbtest/gtest/test_uzfs.cc index a5e5cdb73f9c..33958901cacb 100644 --- a/tests/cbtest/gtest/test_uzfs.cc +++ b/tests/cbtest/gtest/test_uzfs.cc @@ -295,6 +295,9 @@ uzfs_mock_rebuild_scanner_rebuild_comp(void *arg) /* Read ZVOL_OPCODE_REBUILD_STEP */ uzfs_mock_rebuild_scanner_read_rebuild_step(fd, &hdr); +#ifdef DEBUG + inject_error.delay.rebuid_io_quiesce_check_by_pass = 1; +#endif /* Write ZVOL_OPCODE_REBUILD_ALL_SNAP_DONE */ uzfs_mock_rebuild_scanner_write_snap_done(fd, &hdr); while (1) { @@ -377,6 +380,9 @@ uzfs_mock_rebuild_scanner_rebuild_comp(void *arg) EXPECT_EQ(hdr.opcode, ZVOL_OPCODE_REBUILD_COMPLETE); EXPECT_EQ(hdr.status, ZVOL_OP_STATUS_OK); +#ifdef DEBUG + inject_error.delay.rebuid_io_quiesce_check_by_pass = 0; +#endif exit: shutdown(fd, SHUT_RDWR); close(fd); @@ -405,6 +411,7 @@ uzfs_mock_rebuild_scanner_snap_rebuild_related(void *arg) if ((rebuild_test_case >= 8) && (rebuild_test_case <= 12)) { #ifdef DEBUG inject_error.delay.downgraded_replica_rebuild_size_set = 1; + inject_error.delay.rebuid_io_quiesce_check_by_pass = 1; #endif hdr.opcode = ZVOL_OPCODE_REBUILD_SNAP_DONE; hdr.status = ZVOL_OP_STATUS_OK; @@ -487,6 +494,7 @@ uzfs_mock_rebuild_scanner_snap_rebuild_related(void *arg) } #ifdef DEBUG inject_error.delay.downgraded_replica_rebuild_size_set = 0; + inject_error.delay.rebuid_io_quiesce_check_by_pass = 0; #endif exit: From acff067a71a966a273ed498262975c5669d788be Mon Sep 17 00:00:00 2001 From: satbir Date: Thu, 27 Sep 2018 13:42:38 +0530 Subject: [PATCH 2/5] Read should happen on dataset based on zinfo state. Signed-off-by: satbir --- lib/libzrepl/data_conn.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/libzrepl/data_conn.c b/lib/libzrepl/data_conn.c index b8caf0bf8f7e..b11163948393 100644 --- a/lib/libzrepl/data_conn.c +++ b/lib/libzrepl/data_conn.c @@ -341,6 +341,12 @@ uzfs_zvol_worker(void *arg) } } + /* App IOs should go to cloen_zv */ + if (!rebuild_cmd_req && + !ZVOL_IS_HEALTHY(zinfo->main_zv) && + (zinfo->clone_zv != NULL)) + read_zv = zinfo->clone_zv; + rc = uzfs_read_data(read_zv, (char *)zio_cmd->buf, hdr->offset, hdr->len, From 03b762c2118df1e4a858b68f14816a6ee5391188 Mon Sep 17 00:00:00 2001 From: satbir Date: Thu, 27 Sep 2018 15:55:09 +0530 Subject: [PATCH 3/5] Addressed some of the comments Signed-off-by: satbir --- lib/libzrepl/data_conn.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/libzrepl/data_conn.c b/lib/libzrepl/data_conn.c index b11163948393..21f7ae394003 100644 --- a/lib/libzrepl/data_conn.c +++ b/lib/libzrepl/data_conn.c @@ -241,8 +241,7 @@ uzfs_submit_writes(zvol_info_t *zinfo, zvol_io_cmd_t *zio_cmd) } /* IO to clone should be sent only when it is from app */ - if (!is_rebuild && !ZVOL_IS_HEALTHY(zinfo->main_zv) && - (zinfo->clone_zv != NULL)) { + if (!is_rebuild && !ZVOL_IS_HEALTHY(zinfo->main_zv)) { rc = uzfs_write_data(zinfo->clone_zv, datap, data_offset, write_hdr->len, &metadata, is_rebuild); @@ -339,12 +338,8 @@ uzfs_zvol_worker(void *arg) rc = -1; break; } - } - - /* App IOs should go to cloen_zv */ - if (!rebuild_cmd_req && - !ZVOL_IS_HEALTHY(zinfo->main_zv) && - (zinfo->clone_zv != NULL)) + } else if (!ZVOL_IS_HEALTHY(zinfo->main_zv)) + /* App IOs should go to clone_zv */ read_zv = zinfo->clone_zv; rc = uzfs_read_data(read_zv, @@ -1908,6 +1903,8 @@ uzfs_zvol_io_receiver(void *arg) zinfo->is_io_receiver_created = B_FALSE; (void) uzfs_zvol_release_internal_clone(zinfo->main_zv, &zinfo->snap_zv, &zinfo->clone_zv); + zinfo->quiesce_requested = 0; + zinfo->quiesce_done = 1; uzfs_zinfo_drop_refcnt(zinfo); thread_exit: close(fd); From 963ad74bd5dd5529239968b7e41bf2cc63d740a6 Mon Sep 17 00:00:00 2001 From: satbir Date: Thu, 27 Sep 2018 17:18:53 +0530 Subject: [PATCH 4/5] Addressed few more review comments. Signed-off-by: satbir --- cmd/uzfs_test/zrepl_utest.c | 78 --------------------------------- include/sys/zfs_context.h | 1 + include/zrepl_mgmt.h | 1 - lib/libzpool/taskq.c | 13 ++++++ lib/libzrepl/data_conn.c | 15 ++++--- lib/libzrepl/mgmt_conn.c | 1 + tests/cbtest/gtest/test_uzfs.cc | 8 ---- 7 files changed, 23 insertions(+), 94 deletions(-) diff --git a/cmd/uzfs_test/zrepl_utest.c b/cmd/uzfs_test/zrepl_utest.c index 3c6e5e01c412..2a0085b12687 100644 --- a/cmd/uzfs_test/zrepl_utest.c +++ b/cmd/uzfs_test/zrepl_utest.c @@ -295,52 +295,6 @@ zrepl_utest_replica_rebuild_start(int fd, mgmt_ack_t *mgmt_ack, return (0); } -static int -zrepl_send_read(int sfd, uint64_t io_block_size) -{ - - char *buf; - int count; - zvol_io_hdr_t hdr; - struct zvol_io_rw_hdr read_hdr; - - hdr.version = REPLICA_VERSION; - hdr.opcode = ZVOL_OPCODE_READ; - hdr.io_seq = 0; - hdr.len = io_block_size; - hdr.status = 0; - hdr.flags = 0; - hdr.offset = 0; - - count = write(sfd, (void *)&hdr, sizeof (hdr)); - if (count == -1) { - printf("Write error\n"); - return (-1); - } - - count = read(sfd, (void *)&hdr, sizeof (hdr)); - if (count == -1) { - printf("header read failed\n"); - return (-1); - } - - if (hdr.opcode == ZVOL_OPCODE_READ) { - count = read(sfd, &read_hdr, sizeof (read_hdr)); - if (count != sizeof (read_hdr)) { - printf("Meta data header read error\n"); - return (-1); - } - - buf = kmem_alloc(read_hdr.len, KM_SLEEP); - count = read(sfd, buf, read_hdr.len); - free(buf); - if (count == -1) { - printf("payload read failed\n"); - return (-1); - } - } - return (0); -} static void reader_thread(void *arg) @@ -1081,14 +1035,6 @@ zrepl_rebuild_test(void *arg) goto exit; } - /* Send a dummy IO to ds1 so that IO_quiesce check move on */ - if (status_ack.rebuild_status == ZVOL_REBUILDING_AFS) { - sleep(1); - if (zrepl_send_read(ds1_io_sfd, io_block_size) == -1) - goto exit; - goto status_check; - } - if (status_ack.state != ZVOL_STATUS_HEALTHY) { sleep(1); goto status_check; @@ -1156,14 +1102,6 @@ zrepl_rebuild_test(void *arg) goto exit; } - /* Send a dummy IO to ds2 so that IO_quiesce check move on */ - if (status_ack.rebuild_status == ZVOL_REBUILDING_AFS) { - sleep(1); - if (zrepl_send_read(ds2_io_sfd, io_block_size) == -1) - goto exit; - goto status_check1; - } - if (status_ack.state != ZVOL_STATUS_HEALTHY) { sleep(1); goto status_check1; @@ -1233,14 +1171,6 @@ zrepl_rebuild_test(void *arg) goto exit; } - /* Send a dummy IO to ds3 so that IO_quiesce check move on */ - if (status_ack.rebuild_status == ZVOL_REBUILDING_AFS) { - sleep(1); - if (zrepl_send_read(ds3_io_sfd, io_block_size) == -1) - goto exit; - goto status_check2; - } - if (status_ack.rebuild_status != ZVOL_REBUILDING_FAILED) { sleep(1); goto status_check2; @@ -1282,14 +1212,6 @@ zrepl_rebuild_test(void *arg) goto exit; } - /* Send a dummy IO to ds3 so that IO_quiesce check move on */ - if (status_ack.rebuild_status == ZVOL_REBUILDING_AFS) { - sleep(1); - if (zrepl_send_read(ds3_io_sfd, io_block_size) == -1) - goto exit; - goto status_check3; - } - if (status_ack.state != ZVOL_STATUS_HEALTHY) { sleep(1); goto status_check3; diff --git a/include/sys/zfs_context.h b/include/sys/zfs_context.h index 8f153b73d2fc..c1c430074e14 100644 --- a/include/sys/zfs_context.h +++ b/include/sys/zfs_context.h @@ -515,6 +515,7 @@ extern int taskq_member(taskq_t *, kthread_t *); extern int taskq_cancel_id(taskq_t *, taskqid_t); extern void system_taskq_init(void); extern void system_taskq_fini(void); +extern int taskq_check_active_ios(taskq_t *tq); #define XVA_MAPSIZE 3 #define XVA_MAGIC 0x78766174 diff --git a/include/zrepl_mgmt.h b/include/zrepl_mgmt.h index 5df4c7394fd3..4e7d649c446a 100644 --- a/include/zrepl_mgmt.h +++ b/include/zrepl_mgmt.h @@ -73,7 +73,6 @@ typedef struct inject_delay_s { int helping_replica_rebuild_step; int pre_uzfs_write_data; int downgraded_replica_rebuild_size_set; - int rebuid_io_quiesce_check_by_pass; } inject_delay_t; typedef struct inject_error_s { diff --git a/lib/libzpool/taskq.c b/lib/libzpool/taskq.c index 02a16e3f4ee6..161d2024af17 100644 --- a/lib/libzpool/taskq.c +++ b/lib/libzpool/taskq.c @@ -213,6 +213,19 @@ taskq_wait_outstanding(taskq_t *tq, taskqid_t id) taskq_wait(tq); } +int +taskq_check_active_ios(taskq_t *tq) +{ + int ret = 0; + taskq_ent_t *t; + mutex_enter(&tq->tq_lock); + if (((t = tq->tq_task.tqent_next) != &tq->tq_task) || + (tq->tq_active != 0)) + ret = 1; + mutex_exit(&tq->tq_lock); + return (ret); +} + static void taskq_thread(void *arg) { diff --git a/lib/libzrepl/data_conn.c b/lib/libzrepl/data_conn.c index 21f7ae394003..6c8d27f004ce 100644 --- a/lib/libzrepl/data_conn.c +++ b/lib/libzrepl/data_conn.c @@ -693,15 +693,16 @@ uzfs_zvol_rebuild_dw_replica(void *arg) * Wait for all outstanding IOs to be flushed * to disk before making further progress */ -#ifdef DEBUG - if (inject_error.delay.rebuid_io_quiesce_check_by_pass) - continue; -#endif while (1) { - if (!zinfo->quiesce_done) - sleep(1); - else + if (zinfo->quiesce_done || + !taskq_check_active_ios( + zinfo->uzfs_zvol_taskq)) { + zinfo->quiesce_done = 1; + zinfo->quiesce_requested = 0; break; + } + else + sleep(1); } continue; } diff --git a/lib/libzrepl/mgmt_conn.c b/lib/libzrepl/mgmt_conn.c index acaed6126697..2cda031942ec 100644 --- a/lib/libzrepl/mgmt_conn.c +++ b/lib/libzrepl/mgmt_conn.c @@ -1230,6 +1230,7 @@ handle_start_rebuild_req(uzfs_mgmt_conn_t *conn, zvol_io_hdr_t *hdrp, memset(&zinfo->main_zv->rebuild_info, 0, sizeof (zvol_rebuild_info_t)); + zinfo->quiesce_requested = zinfo->quiesce_done = 0; #if 0 if (zinfo->checkpointed_ionum >= max_ioseq) uzfs_zvol_set_rebuild_status(zinfo->main_zv, diff --git a/tests/cbtest/gtest/test_uzfs.cc b/tests/cbtest/gtest/test_uzfs.cc index 33958901cacb..a5e5cdb73f9c 100644 --- a/tests/cbtest/gtest/test_uzfs.cc +++ b/tests/cbtest/gtest/test_uzfs.cc @@ -295,9 +295,6 @@ uzfs_mock_rebuild_scanner_rebuild_comp(void *arg) /* Read ZVOL_OPCODE_REBUILD_STEP */ uzfs_mock_rebuild_scanner_read_rebuild_step(fd, &hdr); -#ifdef DEBUG - inject_error.delay.rebuid_io_quiesce_check_by_pass = 1; -#endif /* Write ZVOL_OPCODE_REBUILD_ALL_SNAP_DONE */ uzfs_mock_rebuild_scanner_write_snap_done(fd, &hdr); while (1) { @@ -380,9 +377,6 @@ uzfs_mock_rebuild_scanner_rebuild_comp(void *arg) EXPECT_EQ(hdr.opcode, ZVOL_OPCODE_REBUILD_COMPLETE); EXPECT_EQ(hdr.status, ZVOL_OP_STATUS_OK); -#ifdef DEBUG - inject_error.delay.rebuid_io_quiesce_check_by_pass = 0; -#endif exit: shutdown(fd, SHUT_RDWR); close(fd); @@ -411,7 +405,6 @@ uzfs_mock_rebuild_scanner_snap_rebuild_related(void *arg) if ((rebuild_test_case >= 8) && (rebuild_test_case <= 12)) { #ifdef DEBUG inject_error.delay.downgraded_replica_rebuild_size_set = 1; - inject_error.delay.rebuid_io_quiesce_check_by_pass = 1; #endif hdr.opcode = ZVOL_OPCODE_REBUILD_SNAP_DONE; hdr.status = ZVOL_OP_STATUS_OK; @@ -494,7 +487,6 @@ uzfs_mock_rebuild_scanner_snap_rebuild_related(void *arg) } #ifdef DEBUG inject_error.delay.downgraded_replica_rebuild_size_set = 0; - inject_error.delay.rebuid_io_quiesce_check_by_pass = 0; #endif exit: From bdd090b26037dff9af5a06948d3cf8b6726820f9 Mon Sep 17 00:00:00 2001 From: satbir Date: Thu, 27 Sep 2018 17:21:45 +0530 Subject: [PATCH 5/5] Sync should happen on clone_zv as well if it is non-null Signed-off-by: satbir --- lib/libzrepl/data_conn.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libzrepl/data_conn.c b/lib/libzrepl/data_conn.c index 6c8d27f004ce..56c468799643 100644 --- a/lib/libzrepl/data_conn.c +++ b/lib/libzrepl/data_conn.c @@ -356,6 +356,8 @@ uzfs_zvol_worker(void *arg) case ZVOL_OPCODE_SYNC: uzfs_flush_data(zinfo->main_zv); + if (zinfo->clone_zv) + uzfs_flush_data(zinfo->clone_zv); atomic_inc_64(&zinfo->sync_req_received_cnt); break;