From patchwork Fri Jul 19 08:31:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Priebe - Profihost AG X-Patchwork-Id: 2830400 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2FCB99F4E2 for ; Fri, 19 Jul 2013 08:38:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 35DCD20444 for ; Fri, 19 Jul 2013 08:38:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DAB1020402 for ; Fri, 19 Jul 2013 08:38:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759955Ab3GSIiW (ORCPT ); Fri, 19 Jul 2013 04:38:22 -0400 Received: from packetbuilder64bit.de-nserver.de ([85.158.179.228]:50469 "EHLO packetbuilder64bit.de-nserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759500Ab3GSIiU (ORCPT ); Fri, 19 Jul 2013 04:38:20 -0400 X-Greylist: delayed 400 seconds by postgrey-1.27 at vger.kernel.org; Fri, 19 Jul 2013 04:38:20 EDT Received: (qmail 7136 invoked by uid 0); 19 Jul 2013 10:31:37 +0200 From: Stefan Priebe To: ceph-devel@vger.kernel.org Cc: Stefan Priebe Subject: [PATCH] mon: use first_commited instead of latest_full map if latest_bl.length() == 0 Date: Fri, 19 Jul 2013 10:31:36 +0200 Message-Id: <1374222696-7100-1-git-send-email-s.priebe@profihost.ag> X-Mailer: git-send-email 1.7.10.4 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP this fixes a failure like: 0> 2013-07-19 09:29:16.803918 7f7fb5f31780 -1 mon/OSDMonitor.cc: In function 'virtual void OSDMonitor::update_from_paxos(bool*)' thread 7f7fb5f31780 time 2013-07-19 09:29:16.803439 mon/OSDMonitor.cc: 132: FAILED assert(latest_bl.length() != 0) ceph version 0.61.5-15-g72c7c74 (72c7c74e1f160e6be39b6edf30bce09b770fa777) 1: (OSDMonitor::update_from_paxos(bool*)+0x16e1) [0x51d121] 2: (PaxosService::refresh(bool*)+0xe6) [0x4f2a46] 3: (Monitor::refresh_from_paxos(bool*)+0x57) [0x48f7b7] 4: (Monitor::init_paxos()+0xe5) [0x48f955] 5: (Monitor::preinit()+0x679) [0x4b1cf9] 6: (main()+0x36b0) [0x484bb0] 7: (__libc_start_main()+0xfd) [0x7f7fb408dc8d] 8: /usr/bin/ceph-mon() [0x4801e9] NOTE: a copy of the executable, or `objdump -rdS ` is needed to interpret this. --- src/mon/OSDMonitor.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 9c854cd..ab3b8ec 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -129,6 +129,12 @@ void OSDMonitor::update_from_paxos(bool *need_bootstrap) if ((latest_full > 0) && (latest_full > osdmap.epoch)) { bufferlist latest_bl; get_version_full(latest_full, latest_bl); + + if (latest_bl.length() == 0 && latest_full != 0 && get_first_committed() > 1) { + dout(0) << __func__ << " latest_bl.length() == 0 use first_commited instead of latest_full" << dendl; + latest_full = get_first_committed(); + get_version_full(latest_full, latest_bl); + } assert(latest_bl.length() != 0); dout(7) << __func__ << " loading latest full map e" << latest_full << dendl; osdmap.decode(latest_bl);