From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Garzik Subject: Re: [tabled patch 1/1] fix the selection of chunk Date: Tue, 25 May 2010 23:46:24 -0400 Message-ID: <4BFC9990.70309@garzik.org> References: <20100525213041.53a1198e@redhat.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=plHeBZvPjDarn4QPJ6kYCWeJd82u4BVl6Cp7CbVfl/Y=; b=gDndeEz9gTXkxfuXH8VP5VT+Ta0EyWmzspPiNFizGHl0l9C20kn/q+y2za35Ns3yPW NrXKf+1GNZQ+9KKe/oFht9QQ+S2jG2/Dqe3fFZs2eKJWIWYo6xJtkfZRV5b3LefJHcNN Gdn3SZvxrI57KqYYQWw8Y8/3QzB9jdzImuuDI= In-Reply-To: <20100525213041.53a1198e@redhat.com> Sender: hail-devel-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: Pete Zaitcev Cc: Project Hail List On 05/25/2010 11:30 PM, Pete Zaitcev wrote: > If a chunkserver goes down, tabled sometimes throws a phantom "object > not found". It happens because we keep hitting the same down node and > exhaust the retries. The existing code calls rand() every time and > hopes for the best, but this is too likely to end poorly. > > The fix is to only randomize once before the retry loop, and then > cycle through all available nodes deterministically. The same fix > would apply even if we used a better technique to select an available > chunkserver than just random. > > Also, we refactor the code just a little bit, so that the enormous > function object_get_body gets somewhat easier to follow. > > Signed-off-by: Pete Zaitcev applied