From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 3DDCB469719 for ; Tue, 20 Oct 2020 20:09:13 +0300 (MSK) Received: by mail-lj1-f193.google.com with SMTP id a28so2850391ljn.3 for ; Tue, 20 Oct 2020 10:09:13 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) From: =?utf-8?B?0JjQu9GM0Y8g0JrQvtC90Y7RhdC+0LI=?= In-Reply-To: <20201013133418.34422-1-sergepetrenko@tarantool.org> Date: Tue, 20 Oct 2020 20:09:10 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <7FC038B7-5195-413E-B030-2974657BA904@gmail.com> References: <20201013133418.34422-1-sergepetrenko@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH] feedback_daemon: add synchro replication usage reporting List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Serge Petrenko Cc: tarantool-patches@dev.tarantool.org Hi, Please increment "feedback_version" each time you patch feedback daemon = report. You can do it here - = https://github.com/tarantool/tarantool/blob/cf6a9c64dea6a4385f3fd4719e44d0= d9dc9ffee9/src/box/lua/feedback_daemon.lua#L359 > 13 =D0=BE=D0=BA=D1=82. 2020 =D0=B3., =D0=B2 16:34, Serge Petrenko = =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB(=D0= =B0): >=20 > --- > https://github.com/tarantool/tarantool/tree/sp/feedback_daemon_synchro >=20 > src/box/lua/feedback_daemon.lua | 12 ++++++++++++ > test/box-tap/feedback_daemon.test.lua | 21 ++++++++++++++++++--- > 2 files changed, 30 insertions(+), 3 deletions(-) >=20 > diff --git a/src/box/lua/feedback_daemon.lua = b/src/box/lua/feedback_daemon.lua > index 179e8fb47..aa296c445 100644 > --- a/src/box/lua/feedback_daemon.lua > +++ b/src/box/lua/feedback_daemon.lua > @@ -150,6 +150,7 @@ local function fill_in_schema_stats_impl(schema) > vinyl =3D 0, > temporary =3D 0, > ['local'] =3D 0, > + sync =3D 0, > } >=20 > local indices =3D { > @@ -188,6 +189,9 @@ local function fill_in_schema_stats_impl(schema) > if space.is_local then > spaces['local'] =3D spaces['local'] + 1 > end > + if space.is_sync then > + spaces.sync =3D spaces.sync + 1 > + end > fill_in_indices_stats(space, indices) >=20 > fiber.yield() > @@ -222,10 +226,18 @@ local function fill_in_features(feedback) > fill_in_schema_stats(feedback.features) > end >=20 > +local function fill_in_options(feedback) > + local options =3D {} > + options.election_mode =3D box.cfg.election_mode > + options.synchro_quorum =3D box.cfg.replication_synchro_quorum > + feedback.options =3D options > +end > + > local function fill_in_feedback(feedback) > fill_in_base_info(feedback) > fill_in_platform_info(feedback) > fill_in_features(feedback) > + fill_in_options(feedback) >=20 > return feedback > end > diff --git a/test/box-tap/feedback_daemon.test.lua = b/test/box-tap/feedback_daemon.test.lua > index a04995d8a..c1ae5f81b 100755 > --- a/test/box-tap/feedback_daemon.test.lua > +++ b/test/box-tap/feedback_daemon.test.lua > @@ -67,7 +67,7 @@ if not ok then > os.exit(0) > end >=20 > -test:plan(19) > +test:plan(21) >=20 > local function check(message) > while feedback_count < 1 do > @@ -152,6 +152,7 @@ local expected =3D { > vinyl_spaces =3D 0, > temporary_spaces =3D 0, > local_spaces =3D 0, > + sync_spaces =3D 0, > tree_indices =3D 0, > rtree_indices =3D 0, > hash_indices =3D 0, > @@ -168,6 +169,7 @@ box.schema.create_space('features_vinyl', {engine = =3D 'vinyl'}) > box.schema.create_space('features_memtx_empty') > box.schema.create_space('features_memtx', > {engine =3D 'memtx', is_local =3D true, temporary =3D true}) > +box.schema.create_space('features_sync', {is_sync=3Dtrue}) > box.space.features_vinyl:create_index('vinyl_pk', {type =3D 'tree'}) > box.space.features_memtx:create_index('memtx_pk', {type =3D 'tree'}) > box.space.features_memtx:create_index('memtx_hash', {type =3D 'hash'}) > @@ -195,11 +197,12 @@ = box.space.features_memtx:create_index('functional_multikey', > actual =3D daemon.generate_feedback() > local schema_stats =3D actual.features.schema > test:test('features.schema', function(t) > - t:plan(12) > - t:is(schema_stats.memtx_spaces, 2, 'memtx engine usage gathered') > + t:plan(13) > + t:is(schema_stats.memtx_spaces, 3, 'memtx engine usage gathered') > t:is(schema_stats.vinyl_spaces, 1, 'vinyl engine usage gathered') > t:is(schema_stats.temporary_spaces, 1, 'temporary space usage = gathered') > t:is(schema_stats.local_spaces, 1, 'local space usage gathered') > + t:is(schema_stats.sync_spaces, 1, 'sync space usage gathered') > t:is(schema_stats.tree_indices, 6, 'tree index gathered') > t:is(schema_stats.hash_indices, 1, 'hash index gathered') > t:is(schema_stats.rtree_indices, 1, 'rtree index gathered') > @@ -216,9 +219,21 @@ actual =3D daemon.generate_feedback() > test:is(actual.features.schema.hash_indices, 2, > 'internal cache invalidates when schema changes') >=20 > +-- > +-- collect synchronous replication and election box.cfg options. > +-- > +em =3D box.cfg.election_mode > +quorum =3D box.cfg.replication_synchro_quorum > +box.cfg{election_mode=3D'candidate', replication_synchro_quorum=3D2} > +actual =3D daemon.generate_feedback() > +test:is(actual.options.election_mode, 'candidate', 'election_mode = option reported') > +test:is(actual.options.synchro_quorum, 2, 'replication_synchro_quorum = option reported') > +box.cfg{election_mode=3Dem, replication_synchro_quorum=3Dquorum} > + > box.space.features_vinyl:drop() > box.space.features_memtx_empty:drop() > box.space.features_memtx:drop() > +box.space.features_sync:drop() >=20 > test:check() > os.exit(0) > --=20 > 2.24.3 (Apple Git-128) >=20