Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 75042200C38 for ; Wed, 1 Mar 2017 06:06:51 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 7390A160B80; Wed, 1 Mar 2017 05:06:51 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BF53F160B7C for ; Wed, 1 Mar 2017 06:06:50 +0100 (CET) Received: (qmail 82648 invoked by uid 500); 1 Mar 2017 05:06:49 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 82637 invoked by uid 99); 1 Mar 2017 05:06:49 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Mar 2017 05:06:49 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 5A3D318E0ED for ; Wed, 1 Mar 2017 05:06:49 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.547 X-Spam-Level: X-Spam-Status: No, score=-1.547 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-2.999, SPF_NEUTRAL=0.652] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id ktQaEdIcCUJ7 for ; Wed, 1 Mar 2017 05:06:48 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 102215FBC1 for ; Wed, 1 Mar 2017 05:06:48 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 59D8EE00D3 for ; Wed, 1 Mar 2017 05:06:47 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 1A68D24158 for ; Wed, 1 Mar 2017 05:06:46 +0000 (UTC) Date: Wed, 1 Mar 2017 05:06:46 +0000 (UTC) From: "Jeff Jirsa (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CASSANDRA-13282) Commitlog replay may fail if last mutation is within 4 bytes of end of segment MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 01 Mar 2017 05:06:51 -0000 [ https://issues.apache.org/jira/browse/CASSANDRA-13282?page=3Dcom.atl= assian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jeff Jirsa updated CASSANDRA-13282: ----------------------------------- Description: Following CASSANDRA-9749 , stricter correctness checks on = commitlog replay can incorrectly detect "corrupt segments" and stop commitl= og replay (and potentially stop cassandra, depending on the configured poli= cy). In {{CommitlogReplayer#replaySyncSection}} we try to read a 4 byte int= {{serializedSize}}, and if it's 0 (which will happen due to zeroing when t= he segment was created), we continue on to the next segment. However, it ap= pears that if a mutation is sized such that it ends with 1, 2, or 3 bytes r= emaining in the segment, we'll pass the {{isEOF}} on the while loop but fai= l to read the {{serializedSize}} int, and fail. (was: Following CASSANDRA= -9749 , stricter correctness checks on commitlog replay can incorrectly det= ect "corrupt segments" and stop commitlog replay (and potentially stop cass= andra, depending on the configured policy). In {{CommitlogReplayer#replaySy= ncSection}} we try to read a 4 byte int {{serializedSize}}, and if it's 0 (= which will happen due to zeroing when the segment was created), we continue= on to the next segment. However, it appears that if a mutation is sized su= ch that it ends with 1, 2, or 3 bytes remaining in the segment, we'll hit p= ass the {{isEOF}} on the while loop but fail to read the {{serializedSize}}= int, and fail. ) > Commitlog replay may fail if last mutation is within 4 bytes of end of se= gment > -------------------------------------------------------------------------= ----- > > Key: CASSANDRA-13282 > URL: https://issues.apache.org/jira/browse/CASSANDRA-1328= 2 > Project: Cassandra > Issue Type: Bug > Components: Core > Reporter: Jeff Jirsa > Assignee: Jeff Jirsa > Fix For: 3.0.x, 3.11.x, 4.x > > > Following CASSANDRA-9749 , stricter correctness checks on commitlog repla= y can incorrectly detect "corrupt segments" and stop commitlog replay (and = potentially stop cassandra, depending on the configured policy). In {{Commi= tlogReplayer#replaySyncSection}} we try to read a 4 byte int {{serializedSi= ze}}, and if it's 0 (which will happen due to zeroing when the segment was = created), we continue on to the next segment. However, it appears that if a= mutation is sized such that it ends with 1, 2, or 3 bytes remaining in the= segment, we'll pass the {{isEOF}} on the while loop but fail to read the {= {serializedSize}} int, and fail.=20 -- This message was sent by Atlassian JIRA (v6.3.15#6346)