From issues-return-844-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Mon Sep 2 08:04:02 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 45000180674 for ; Mon, 2 Sep 2019 10:04:02 +0200 (CEST) Received: (qmail 27017 invoked by uid 500); 2 Sep 2019 08:24:41 -0000 Mailing-List: contact issues-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zookeeper.apache.org Delivered-To: mailing list issues@zookeeper.apache.org Received: (qmail 26996 invoked by uid 99); 2 Sep 2019 08:24:40 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Sep 2019 08:24:40 +0000 Received: from jira-he-de.apache.org (static.172.67.40.188.clients.your-server.de [188.40.67.172]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id DADF7E00CD for ; Mon, 2 Sep 2019 08:04:00 +0000 (UTC) Received: from jira-he-de.apache.org (localhost.localdomain [127.0.0.1]) by jira-he-de.apache.org (ASF Mail Server at jira-he-de.apache.org) with ESMTP id 4B745780927 for ; Mon, 2 Sep 2019 08:04:00 +0000 (UTC) Date: Mon, 2 Sep 2019 08:04:00 +0000 (UTC) From: "maoling (Jira)" To: issues@zookeeper.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Assigned] (ZOOKEEPER-3231) Purge task may lost data when we have many invalid snapshots. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/ZOOKEEPER-3231?page=3Dcom.atla= ssian.jira.plugin.system.issuetabpanels:all-tabpanel ] maoling reassigned ZOOKEEPER-3231: ---------------------------------- Assignee: maoling > Purge task may lost data when we have many invalid snapshots. > -------------------------------------------------------------- > > Key: ZOOKEEPER-3231 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-3231 > Project: ZooKeeper > Issue Type: Bug > Components: server > Affects Versions: 3.5.4, 3.4.13 > Reporter: Jiafu Jiang > Assignee: maoling > Priority: Major > > I=C2=A0read the ZooKeeper source code, and I find the purge task use=C2= =A0FileTxnSnapLog#findNRecentSnapshots to find snapshots, but the method do= es not check whether the snapshots are valid. > Consider a worse case, a ZooKeeper server may have many invalid snapshots= , and when a purge task begins, it will use the zxid in the last snapshot's= name to purge old snapshots and transaction logs, then we may lost data.= =C2=A0 > I think we should use=C2=A0FileSnap#findNValidSnapshots(int)=C2=A0instead= of FileSnap#findNRecentSnapshots in=C2=A0FileTxnSnapLog#findNRecentSnapsho= ts, but I am not sure. > =C2=A0 -- This message was sent by Atlassian Jira (v8.3.2#803003)