From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org> To: tarantool-patches@freelists.org, Alex Khatskevich <avkhatskevich@tarantool.org> Subject: [tarantool-patches] Re: [PATCH][vshard] Log warning on duplicate replica.name Date: Thu, 7 Jun 2018 22:05:10 +0300 [thread overview] Message-ID: <77a9d201-6cad-c92f-3cdf-d667a14705f3@tarantool.org> (raw) In-Reply-To: <26948b8a-a552-d558-df71-490c81916d7f@tarantool.org> Great! Thanks for the fixes! But see the diff that I applied and pushed into the master branch: diff --git a/test/unit/config.result b/test/unit/config.result index b82303b..6b4f87b 100644 --- a/test/unit/config.result +++ b/test/unit/config.result @@ -161,9 +161,9 @@ cfg.sharding['rsid2'] = replicaset2 _ = check(cfg) --- ... -test_run:grep_log('default', 'Duplicate replica.name found: dup_name1') +test_run:grep_log('default', 'Duplicate replica.name is found: dup_name1') --- -- 'Duplicate replica.name found: dup_name1' +- 'Duplicate replica.name is found: dup_name1' ... cfg.sharding['rsid2'] = nil --- @@ -190,9 +190,9 @@ cfg.sharding['rsid3'] = replicaset3 _ = check(cfg) --- ... -test_run:grep_log('default', 'Duplicate replica.name found: dup_name2') +test_run:grep_log('default', 'Duplicate replica.name is found: dup_name2') --- -- 'Duplicate replica.name found: dup_name2' +- 'Duplicate replica.name is found: dup_name2' ... cfg.sharding['rsid2'] = nil --- diff --git a/test/unit/config.test.lua b/test/unit/config.test.lua index 9b2b7be..0f549d3 100644 --- a/test/unit/config.test.lua +++ b/test/unit/config.test.lua @@ -75,7 +75,7 @@ replica2_2 = {uri = 'uri:uri@uri2_2', name = 'dup_name1', master = false} replicaset2 = {replicas = {['id2'] = replica2_1, ['id3'] = replica2_2}} cfg.sharding['rsid2'] = replicaset2 _ = check(cfg) -test_run:grep_log('default', 'Duplicate replica.name found: dup_name1') +test_run:grep_log('default', 'Duplicate replica.name is found: dup_name1') cfg.sharding['rsid2'] = nil -- name duplicate in different replicasets. @@ -86,7 +86,7 @@ replicaset3 = {replicas = {['id3'] = replica3}} cfg.sharding['rsid2'] = replicaset2 cfg.sharding['rsid3'] = replicaset3 _ = check(cfg) -test_run:grep_log('default', 'Duplicate replica.name found: dup_name2') +test_run:grep_log('default', 'Duplicate replica.name is found: dup_name2') cfg.sharding['rsid2'] = nil cfg.sharding['rsid3'] = nil diff --git a/vshard/cfg.lua b/vshard/cfg.lua index 7a25cc9..f5db4c0 100644 --- a/vshard/cfg.lua +++ b/vshard/cfg.lua @@ -160,14 +160,15 @@ local function check_sharding(sharding) error(string.format('Duplicate uuid %s', replica_uuid)) end uuids[replica_uuid] = true - -- Log warning in case replica.name duplicate found. - -- Message appears once for each unique duplicate. + -- Log warning in case replica.name duplicate is + -- found. Message appears once for each unique + -- duplicate. local name = replica.name if name then if names[name] == nil then names[name] = 1 elseif names[name] == 1 then - log.warn('Duplicate replica.name found: %s', name) + log.warn('Duplicate replica.name is found: %s', name) -- Next duplicates should not be reported. names[name] = 2 end
prev parent reply other threads:[~2018-06-07 19:05 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-06-07 11:50 [tarantool-patches] " AKhatskevich 2018-06-07 14:49 ` [tarantool-patches] " Vladislav Shpilevoy 2018-06-07 16:44 ` Alex Khatskevich 2018-06-07 19:05 ` Vladislav Shpilevoy [this message]
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=77a9d201-6cad-c92f-3cdf-d667a14705f3@tarantool.org \ --to=v.shpilevoy@tarantool.org \ --cc=avkhatskevich@tarantool.org \ --cc=tarantool-patches@freelists.org \ --subject='[tarantool-patches] Re: [PATCH][vshard] Log warning on duplicate replica.name' \ /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
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox