From owner-freebsd-questions@FreeBSD.ORG Sun Feb 24 10:05:17 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D2063C17; Sun, 24 Feb 2013 10:05:17 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-ea0-f178.google.com (mail-ea0-f178.google.com [209.85.215.178]) by mx1.freebsd.org (Postfix) with ESMTP id 435DE1AED; Sun, 24 Feb 2013 10:05:16 +0000 (UTC) Received: by mail-ea0-f178.google.com with SMTP id a14so853189eaa.9 for ; Sun, 24 Feb 2013 02:05:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=we0KAKPihB4RgCU3EBAIxqh68YEQIN7EvbQsj1lY5qE=; b=O4HLJW1CrxgB7kGTsN8w84c2HTvz0SkR9NTnBBLDLSN6Fb+kCtEW2JLdfd6ihu6i+j +e9eJOLTKNZt2t2HIwX6JpZCtUbFMmmt9x7lCDHQCiZtOYsOSKWFWeBGWg91PiITjKT8 v8go9v8gDIDT5mNfpV9WydQhrkHpsXSmFbN6vDMvntGVNymCSIUeWE3mrLqB/3N0iEBF PDZRzMd2i4S5Qn1LD3Bnklg6ldhFvCm9yW7eSlczWAxsLn3+gmN+V3sN9KOO2tz1PQRD URMfmiX00MKZhoeD/wez+GZJJPButtvfIdcSSwz7LweEPRSEAoWqtjFB/926lAscUlMM y+qg== X-Received: by 10.14.1.130 with SMTP id 2mr26537219eed.15.1361700309840; Sun, 24 Feb 2013 02:05:09 -0800 (PST) Received: from localhost ([178.150.115.244]) by mx.google.com with ESMTPS id u44sm12998121eel.7.2013.02.24.02.05.08 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 24 Feb 2013 02:05:08 -0800 (PST) Sender: Mikolaj Golub Date: Sun, 24 Feb 2013 12:05:06 +0200 From: Mikolaj Golub To: Pawel Jakub Dawidek Subject: Re: HAST - detect failure and restore avoiding an outage? Message-ID: <20130224100503.GA19308@gmail.com> References: <20130221220042.GA2900@gmail.com> <20130223205103.GN1377@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130223205103.GN1377@garage.freebsd.pl> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Chad M Stewart , freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Feb 2013 10:05:17 -0000 On Sat, Feb 23, 2013 at 09:51:03PM +0100, Pawel Jakub Dawidek wrote: > I'm fine with the patchi except for missing breaks in switch added to > hastd/primary.c. Oops. Fixed. Thanks! > I'm also wondering... You count all those errors separately just to > print them as one number. If we do that already let's print them > separately, eg. > > local i/o errors: read(0), write(3), delete(5), flush(9) The idea was that hastd provided all available counters, and hastctl showed only aggregated counter just to save a screen space, but if one wanted to write its own utility to monitor hastd, which would talk directly to hastd via socket, she would be able to see all counters separately. But your idea with writing errors in one string looks better, as it allows to save a screen space and provide more detailed info. I would prefer a little different output though: role: secondary provname: test localpath: /dev/md102 extentsize: 2097152 (2.0MB) keepdirty: 0 remoteaddr: kopusha:7771 replication: memsync status: complete dirty: 0 (0B) statistics: reads: 13 writes: 521 deletes: 0 flushes: 0 activemap updates: 0 local i/o errors: read: 13, write: 425, delete: 0, flush: 0 but don't have a strong opinion and will be ok with yours if you don't like my version. > > BTW. Why not to count activemap update errors as write and flush errors? I need (internally) separate counters for activemap errors because they are updated by the different thread and I wouldn't want to introduce locking for error counter update operations. As hastctl was supposed to show an aggregated counter I didn't bother much how to make activemap update errors to count as write and flush errors. I improved this too in the updated patch: http://people.freebsd.org/~trociny/hast.stat_error.2.patch -- Mikolaj Golub