From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id A86066EC40; Thu, 3 Jun 2021 17:13:09 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org A86066EC40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1622729589; bh=eAtqfoZZO3LqZnRDmuLymFQ5K4vGADfE4xjDgFJPtQI=; h=To:References:Date:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=DHL6NOBIV5CONinOSywW1/iGUDR7eCa9vHzoPtpkPSRQpNd2MSvbd0V6T8ZYBNKrp c0QiiQXd/f9y2YnmkIRa1oCOiKmeb++yYe1mBQ+PMW2VjkdSfU1VRNsqA9rgs3I9Ln 61Kv43nvTBCJqbMWzI7tbZR+m/hnD6lZyx0h37mo= Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 69E586EC40 for ; Thu, 3 Jun 2021 17:13:08 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 69E586EC40 Received: by smtpng2.m.smailru.net with esmtpa (envelope-from ) id 1loo5r-0007bn-5E; Thu, 03 Jun 2021 17:13:07 +0300 To: Oleg Babin , tarantool-patches@dev.tarantool.org, yaroslav.dynnikov@tarantool.org References: <38f8a40b-4fe7-f26a-ddc5-7f088445e4f2@tarantool.org> Message-ID: <33f79dab-fbd1-f640-117c-98bd06b28be1@tarantool.org> Date: Thu, 3 Jun 2021 16:13:05 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9D5B0DA836B685C544BBC2A69B1B4100B389BF69B7A224D7C182A05F5380850408A7247EAF6073B6544D15938C0F9C4DAC46C39C935850D2C63F4AFD5FD0C5A87 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE764C944B6AA401A18EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637F0D8FAB78312C5B48638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8B6C255CBD5AF48F9B028A623D6F3FEBC117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCEC1C9C6CFAD2A0F5A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F4460429728776938767073520B1593CA6EC85F86D28451B159A507268D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B6B1CFA6D474D4A6A4089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2AD77751E876CB595E8F7B195E1C97831F38AD7AA3BBE1B6C1BBFD1EA3789D373 X-C1DE0DAB: 0D63561A33F958A5DE28FD66F5CA940B239E68AF117F9F51BCDDEB1618B52DB0D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75FBC5FED0552DA851410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34CA9B3B5DE5D383E6919B8A731354F1D9A3637EA36EA44429F960CBA06E9924063E7F75D076B2B0371D7E09C32AA3244C624F3CB97B88E3A67DA01D98E8DF0ABDF522A1CF68F4BE05FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojNbQUdF9mq4GnRH5od0eDPw== X-Mailru-Sender: 689FA8AB762F73936BC43F508A0638220677789FAB501AF31369318A9DC3A3BD3841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E267EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH vshard 1/1] recovery: relax recovery messages verbosity X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Vladislav Shpilevoy via Tarantool-patches Reply-To: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" >>>> diff --git a/vshard/storage/init.lua b/vshard/storage/init.lua >>>> index 7045d91..8a019fa 100644 >>>> --- a/vshard/storage/init.lua >>>> +++ b/vshard/storage/init.lua >>>> @@ -736,21 +736,25 @@ local function recovery_step_by_type(type) >>>>        local is_empty = true >>> To be honest I don't completely understand what "is_empty" means. >> It means the recovery step is empty - didn't find anything to >> recover. >> >> I use it so as not to log 'Starting ... buckets recovery step' on >> each call of recovery_step_by_type() - would be too many useless >> logs. > > > Ok, thanks for your answers. Probably, it's better to rename "is_empty" to "step_is_empty". > > It's ok if you'll answer "no", since it's refactoring. Ok, I don't mind. Just 2 lines of extra diff appear, not a big deal. The full new patch is below. But I used 'is_step_empty'. Because the flags should have is/has/does/... in their prefix, not suffix or ending. ==================== recovery: relax recovery messages verbosity Recovery fiber on the storages used to print messages about starting recovery even when no recovery was needed yet: Starting ... buckets recovery step Finish bucket recovery step It happened a lot during rebalancing even if it worked fine. Because there appear receiving/sending buckets, and recovery double-checks if they are really transferring, not stuck. The patch makes recovery fiber not account the buckets, whose transfer is actually in progress, as broken. Hence it won't print the recovery messages anymore unless the transfer was really interrupted. Along with that the recovery now prints more details about the first bucket which triggered the real recovery. Closes #274 diff --git a/vshard/storage/init.lua b/vshard/storage/init.lua index 7045d91..14ec42b 100644 --- a/vshard/storage/init.lua +++ b/vshard/storage/init.lua @@ -733,24 +733,28 @@ end -- local function recovery_step_by_type(type) local _bucket = box.space._bucket - local is_empty = true + local is_step_empty = true local recovered = 0 local total = 0 + local start_format = 'Starting %s buckets recovery step' for _, bucket in _bucket.index.status:pairs(type) do total = total + 1 local bucket_id = bucket.id if M.rebalancer_transfering_buckets[bucket_id] then goto continue end - if is_empty then - log.info('Starting %s buckets recovery step', type) - end - is_empty = false assert(bucket_is_transfer_in_progress(bucket)) - local destination = M.replicasets[bucket.destination] + local peer_uuid = bucket.destination + local destination = M.replicasets[peer_uuid] if not destination or not destination.master then -- No replicaset master for a bucket. Wait until it -- appears. + if is_step_empty then + log.info(start_format, type) + log.warn('Can not find for bucket %s its peer %s', bucket_id, + peer_uuid) + is_step_empty = false + end goto continue end local remote_bucket, err = @@ -759,6 +763,15 @@ local function recovery_step_by_type(type) -- not be used to recovery anything. Try later. if not remote_bucket and (not err or err.type ~= 'ShardingError' or err.code ~= lerror.code.WRONG_BUCKET) then + if is_step_empty then + if err == nil then + err = 'unknown' + end + log.info(start_format, type) + log.error('Error during recovery of bucket %s on replicaset '.. + '%s: %s', bucket_id, peer_uuid, err) + is_step_empty = false + end goto continue end -- Do nothing until the bucket on both sides stopped @@ -772,16 +785,23 @@ local function recovery_step_by_type(type) if not bucket or not bucket_is_transfer_in_progress(bucket) then goto continue end + if is_step_empty then + log.info(start_format, type) + end if recovery_local_bucket_is_garbage(bucket, remote_bucket) then _bucket:update({bucket_id}, {{'=', 2, consts.BUCKET.GARBAGE}}) recovered = recovered + 1 elseif recovery_local_bucket_is_active(bucket, remote_bucket) then _bucket:replace({bucket_id, consts.BUCKET.ACTIVE}) recovered = recovered + 1 + elseif is_step_empty then + log.info('Bucket %s is %s local and %s on replicaset %s, waiting', + bucket_id, bucket.status, remote_bucket.status, peer_uuid) end + is_step_empty = false ::continue:: end - if not is_empty then + if not is_step_empty then log.info('Finish bucket recovery step, %d %s buckets are recovered '.. 'among %d', recovered, type, total) end