Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6398665ybx; Mon, 11 Nov 2019 08:32:07 -0800 (PST) X-Google-Smtp-Source: APXvYqzq+i5GaecjaywVw+awwBEyRtIm7MQ8J27kMyRBbVbwIKDgpLSL/+vGCGnXmhXjh7oxMoqA X-Received: by 2002:a17:906:194a:: with SMTP id b10mr23787769eje.123.1573489927519; Mon, 11 Nov 2019 08:32:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573489927; cv=none; d=google.com; s=arc-20160816; b=iAzRjzi30rq/KVSMxDvUTxVUiGklFABW5gnbDj8vvj5gcQotStaerl2fO63lqUQw5Z ThcKASYXyn0/P2+s6JBxQvkp5agYLKcAq8cXJnNXbdD0sbPvvnghT/g1EoXblA8fGeB1 0jvmpDDZrGmsVgA2xwTnIq+ykj52UYt4evA28puibwCPw2pzx2wn9jIRjiuGrpKR1324 APb4wZdB1U+04HrSYSF9bY51CGvne5Kv8HAD+MRWgQOcAzFy+5WWDs9+QD5/eKga1Ufg sgScjF5w35y3RQrL6hqVpBZI5Al811uJSUf3mJ55x2xvhJ5S8eL2PjAFz4DJ1Emc7WKL h1EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=FHZFS5op6KYEBUiCWmGiyEsM0NJXbVxKPquoT46npXw=; b=O+koSdvwMa8xuAR9NvcrTOA5178P5vtcYHKbWZCiAAnHAfkmBlTDmsf8/3cuv6zC8n WZ5de9Bhxcsfuo4dVx9mB4mHZbjaeWOZE/SD7bMs0eevBky/W66QPB/yaNb2yxFhHSAY H2GgV9G0wo4VcvHinAYfqz9NQi4/lYU329KDSrQz7KBFenFHHljt9aGrfgawMUuPKQ19 Mh7ey1HDe3flYXBpw7KaPAZ2dSHksRDw/8Fg5axXn1sl9GWvipI4dKfA3yAvrdHXh+te xojjfcyl35KwXGmRfzIOLTeXcy5jQnq6csvNqU/C1GMsBs1cos6qe861J3z/WqaENfP5 AcZQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o22si9231314eja.122.2019.11.11.08.31.41; Mon, 11 Nov 2019 08:32:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726952AbfKKQak (ORCPT + 99 others); Mon, 11 Nov 2019 11:30:40 -0500 Received: from mx2.suse.de ([195.135.220.15]:57020 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726871AbfKKQak (ORCPT ); Mon, 11 Nov 2019 11:30:40 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 72E0CB3F1; Mon, 11 Nov 2019 16:30:37 +0000 (UTC) Date: Mon, 11 Nov 2019 16:30:36 +0000 From: Luis Henriques To: Sage Weil Cc: Ilya Dryomov , Jeff Layton , "Yan, Zheng" , Ceph Development , LKML Subject: Re: [RFC PATCH 0/2] ceph: safely use 'copy-from' Op on Octopus OSDs Message-ID: <20191111163036.GA20513@hermes.olymp> References: <20191108141555.31176-1-lhenriques@suse.com> <20191108164758.GA1760@hermes.olymp> <20191108171616.GA2569@hermes.olymp> <20191108173101.GA3300@hermes.olymp> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20191108173101.GA3300@hermes.olymp> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 08, 2019 at 05:31:01PM +0000, Luis Henriques wrote: > > - You'll need to add it for both OSDMap::Incremental and OSDMap > > - You'll need to make the encoding condition by updating the block like > > the one below from OSDMap::encode() > > > > uint8_t v = 9; > > if (!HAVE_FEATURE(features, SERVER_LUMINOUS)) { > > v = 3; > > } else if (!HAVE_FEATURE(features, SERVER_MIMIC)) { > > v = 6; > > } else if (!HAVE_FEATURE(features, SERVER_NAUTILUS)) { > > v = 7; > > } > > > > to include a SERVER_OCTOPUS case too. Same goes for Incremental::encode() > > Awesome, thanks! I'll give it a try, and test it with the appropriate > kernel client side changes to use this. Ok, I've got the patch bellow for the OSD code, which IIRC should do exactly what we want: duplicate the require_osd_release in the client side. Now, in order to quickly test this I've started adding flags to the CEPH_FEATURES_SUPPORTED_DEFAULT definition. SERVER_MIMIC *seemed* to be Ok, but once I've added SERVER_NAUTILUS I've realized that we'll need to handle TYPE_MSGR2 address. Which is a _big_ thing. Is anyone already looking into adding support for msgr v2 to the kernel client? Cheers, -- Lu?s diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index 6b5930743a33..b38d91d98fcf 100644 --- a/src/osd/OSDMap.cc +++ b/src/osd/OSDMap.cc @@ -555,13 +555,15 @@ void OSDMap::Incremental::encode(ceph::buffer::list& bl, uint64_t features) cons ENCODE_START(8, 7, bl); { - uint8_t v = 8; + uint8_t v = 9; if (!HAVE_FEATURE(features, SERVER_LUMINOUS)) { v = 3; } else if (!HAVE_FEATURE(features, SERVER_MIMIC)) { v = 5; } else if (!HAVE_FEATURE(features, SERVER_NAUTILUS)) { v = 6; + } else if (!HAVE_FEATURE(features, SERVER_OCTOPUS)) { + v = 8; } ENCODE_START(v, 1, bl); // client-usable data encode(fsid, bl); @@ -611,6 +613,9 @@ void OSDMap::Incremental::encode(ceph::buffer::list& bl, uint64_t features) cons encode(new_last_up_change, bl); encode(new_last_in_change, bl); } + if (v >= 9) { + encode(new_require_osd_release, bl); + } ENCODE_FINISH(bl); // client-usable data } @@ -816,7 +821,7 @@ void OSDMap::Incremental::decode(ceph::buffer::list::const_iterator& bl) return; } { - DECODE_START(8, bl); // client-usable data + DECODE_START(9, bl); // client-usable data decode(fsid, bl); decode(epoch, bl); decode(modified, bl); @@ -2847,13 +2852,15 @@ void OSDMap::encode(ceph::buffer::list& bl, uint64_t features) const { // NOTE: any new encoding dependencies must be reflected by // SIGNIFICANT_FEATURES - uint8_t v = 9; + uint8_t v = 10; if (!HAVE_FEATURE(features, SERVER_LUMINOUS)) { v = 3; } else if (!HAVE_FEATURE(features, SERVER_MIMIC)) { v = 6; } else if (!HAVE_FEATURE(features, SERVER_NAUTILUS)) { v = 7; + } else if (!HAVE_FEATURE(features, SERVER_OCTOPUS)) { + v = 9; } ENCODE_START(v, 1, bl); // client-usable data // base @@ -2929,6 +2936,9 @@ void OSDMap::encode(ceph::buffer::list& bl, uint64_t features) const encode(last_up_change, bl); encode(last_in_change, bl); } + if (v >= 10) { + encode(require_osd_release, bl); + } ENCODE_FINISH(bl); // client-usable data } @@ -3170,7 +3180,7 @@ void OSDMap::decode(ceph::buffer::list::const_iterator& bl) * Since we made it past that hurdle, we can use our normal paths. */ { - DECODE_START(9, bl); // client-usable data + DECODE_START(10, bl); // client-usable data // base decode(fsid, bl); decode(epoch, bl);