From: Lukas Straub <lukasstraub2@web.de>
To: "Zhang, Chen" <chen.zhang@intel.com>
Cc: "kwolf@redhat.com" <kwolf@redhat.com>,
Wen Congyang <wencongyang2@huawei.com>,
Jason Wang <jasowang@redhat.com>,
qemu-devel <qemu-devel@nongnu.org>,
"mreitz@redhat.com" <mreitz@redhat.com>,
Xie Changlong <xiechanglong.d@gmail.com>
Subject: Re: [PATCH v5 2/4] tests/test-replication.c: Add test for ignoring requests after failover
Date: Sat, 28 Sep 2019 13:07:25 +0200 [thread overview]
Message-ID: <20190928130628.38407661@luklap> (raw)
In-Reply-To: <9CFF81C0F6B98A43A459C9EDAD400D780627E731@shsmsx102.ccr.corp.intel.com>
On Thu, 26 Sep 2019 17:40:03 +0000
"Zhang, Chen" <chen.zhang@intel.com> wrote:
> > -----Original Message-----
> > From: Lukas Straub <lukasstraub2@web.de>
> > Sent: Monday, September 16, 2019 3:20 AM
> > To: qemu-devel <qemu-devel@nongnu.org>
> > Cc: Zhang, Chen <chen.zhang@intel.com>; Jason Wang
> > <jasowang@redhat.com>; Wen Congyang <wencongyang2@huawei.com>;
> > Xie Changlong <xiechanglong.d@gmail.com>; kwolf@redhat.com;
> > mreitz@redhat.com
> > Subject: [PATCH v5 2/4] tests/test-replication.c: Add test for ignoring
> > requests after failover
> >
> > This simulates the case that happens when we resume COLO after failover.
> >
>
> It looks change the title to "Add test for secondary node continuous backup" is better.
Did you mean "continuous replication"? Would "Add test for secondary node continuing replication" be Ok?
> > Signed-off-by: Lukas Straub <lukasstraub2@web.de>
> > ---
> > tests/test-replication.c | 52
> > ++++++++++++++++++++++++++++++++++++++++
> > 1 file changed, 52 insertions(+)
> >
> > diff --git a/tests/test-replication.c b/tests/test-replication.c index
> > f085d1993a..5addfc2227 100644
> > --- a/tests/test-replication.c
> > +++ b/tests/test-replication.c
> > @@ -489,6 +489,56 @@ static void test_secondary_stop(void)
> > teardown_secondary();
> > }
> >
> > +static void test_secondary_failover_then_ignore_requests(void)
>
> Same as title, I think change to "test_secondary_continuous_backup" is more clear.
>
> Thanks
> Zhang Chen
>
> > +{
> > + BlockBackend *top_blk, *local_blk;
> > + Error *local_err = NULL;
> > +
> > + top_blk = start_secondary();
> > + replication_start_all(REPLICATION_MODE_SECONDARY, &local_err);
> > + g_assert(!local_err);
> > +
> > + /* write 0x22 to s_local_disk (IMG_SIZE / 2, IMG_SIZE) */
> > + local_blk = blk_by_name(S_LOCAL_DISK_ID);
> > + test_blk_write(local_blk, 0x22, IMG_SIZE / 2, IMG_SIZE / 2, false);
> > +
> > + /* replication will backup s_local_disk to s_hidden_disk */
> > + test_blk_read(top_blk, 0x11, IMG_SIZE / 2,
> > + IMG_SIZE / 2, 0, IMG_SIZE, false);
> > +
> > + /* write 0x33 to s_active_disk (0, IMG_SIZE / 2) */
> > + test_blk_write(top_blk, 0x33, 0, IMG_SIZE / 2, false);
> > +
> > + /* do failover (active commit) */
> > + replication_stop_all(true, &local_err);
> > + g_assert(!local_err);
> > +
> > + /* it should ignore all requests from now on */
> > +
> > + /* start after failover */
> > + replication_start_all(REPLICATION_MODE_PRIMARY, &local_err);
> > + g_assert(!local_err);
> > +
> > + /* checkpoint */
> > + replication_do_checkpoint_all(&local_err);
> > + g_assert(!local_err);
> > +
> > + /* stop */
> > + replication_stop_all(true, &local_err);
> > + g_assert(!local_err);
> > +
> > + /* read from s_local_disk (0, IMG_SIZE / 2) */
> > + test_blk_read(top_blk, 0x33, 0, IMG_SIZE / 2,
> > + 0, IMG_SIZE / 2, false);
> > +
> > +
> > + /* read from s_local_disk (IMG_SIZE / 2, IMG_SIZE) */
> > + test_blk_read(top_blk, 0x22, IMG_SIZE / 2,
> > + IMG_SIZE / 2, 0, IMG_SIZE, false);
> > +
> > + teardown_secondary();
> > +}
> > +
> > static void test_secondary_do_checkpoint(void)
> > {
> > BlockBackend *top_blk, *local_blk;
> > @@ -584,6 +634,8 @@ int main(int argc, char **argv)
> > g_test_add_func("/replication/secondary/write", test_secondary_write);
> > g_test_add_func("/replication/secondary/start", test_secondary_start);
> > g_test_add_func("/replication/secondary/stop", test_secondary_stop);
> > +
> > g_test_add_func("/replication/secondary/failover_then_ignore_requests",
> > + test_secondary_failover_then_ignore_requests);
> > g_test_add_func("/replication/secondary/do_checkpoint",
> > test_secondary_do_checkpoint);
> > g_test_add_func("/replication/secondary/get_error_all",
> > --
> > 2.20.1
>
next prev parent reply other threads:[~2019-09-28 13:33 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-15 19:19 [Qemu-devel] [PATCH v5 0/4] colo: Add support for continuous replication Lukas Straub
2019-09-15 19:19 ` [Qemu-devel] [PATCH v5 1/4] block/replication.c: Ignore requests after failover Lukas Straub
2019-09-26 16:52 ` Zhang, Chen
2019-09-15 19:20 ` [Qemu-devel] [PATCH v5 2/4] tests/test-replication.c: Add test for ignoring " Lukas Straub
2019-09-26 17:40 ` Zhang, Chen
2019-09-28 11:07 ` Lukas Straub [this message]
2019-09-30 20:13 ` Zhang, Chen
2019-09-15 19:20 ` [Qemu-devel] [PATCH v5 3/4] net/filter.c: Add Options to insert filters anywhere in the filter list Lukas Straub
2019-09-26 17:02 ` Zhang, Chen
2019-09-28 10:44 ` Lukas Straub
2019-09-30 20:13 ` Zhang, Chen
2019-09-15 19:20 ` [Qemu-devel] [PATCH v5 4/4] colo: Update Documentation for continuous replication Lukas Straub
2019-09-26 17:27 ` Zhang, Chen
2019-09-28 13:25 ` Lukas Straub
2019-09-30 20:11 ` Zhang, Chen
2019-09-26 16:09 ` [PATCH v5 0/4] colo: Add support " Lukas Straub
2019-09-26 16:13 ` Zhang, Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190928130628.38407661@luklap \
--to=lukasstraub2@web.de \
--cc=chen.zhang@intel.com \
--cc=jasowang@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=wencongyang2@huawei.com \
--cc=xiechanglong.d@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.