Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0386F9EA4 for ; Fri, 11 May 2012 16:11:52 +0000 (UTC) Received: (qmail 81038 invoked by uid 500); 11 May 2012 16:11:49 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 81002 invoked by uid 500); 11 May 2012 16:11:49 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 80993 invoked by uid 99); 11 May 2012 16:11:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 May 2012 16:11:49 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of omidaladini@gmail.com designates 209.85.160.44 as permitted sender) Received: from [209.85.160.44] (HELO mail-pb0-f44.google.com) (209.85.160.44) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 May 2012 16:11:43 +0000 Received: by pbcwy7 with SMTP id wy7so3639844pbc.31 for ; Fri, 11 May 2012 09:11:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=IV0u07SbYAt0L10AjP2ah38qJisfbh4cYIvKRs18nrE=; b=VK4mQ5IwIZAxfNKhs/XyWOi0dhDW561F++k6NCkpRhGy/sMwZnIzOR4IhgywIt+kkX H8M3XqUd3N0QM/1NOcU+CykB6UFxdOFIznXWPSHeNwtEcshqTsgl2yN8ri//ncPHNdt6 wTrCR0ED0SpIN2y3/b5ETmGNfO6dqTZvpbv99KifNfheFU0ZbJB9VimymZyYWu6XHlsj g1xsRGpWAaxEKeR2f1hmY7a1FWc+OgrHK2fvC8rQYqhc6W/deOZeuvOM3Dtg6JclUsD5 E9ejEo8CZMN0PcTgv8QvbAxI2CG8yk1lwGM4KrW4mfzXyaAwepOvJgv5A7hMPGq0pC2G oIoA== Received: by 10.68.216.33 with SMTP id on1mr31777086pbc.105.1336752681568; Fri, 11 May 2012 09:11:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.226.34 with HTTP; Fri, 11 May 2012 09:10:41 -0700 (PDT) In-Reply-To: <1745B02C-7AA2-4204-A220-BAABD75A6856@thelastpickle.com> References: <1745B02C-7AA2-4204-A220-BAABD75A6856@thelastpickle.com> From: Omid Aladini Date: Fri, 11 May 2012 18:10:41 +0200 Message-ID: Subject: Re: Losing key cache on restart To: user@cassandra.apache.org Content-Type: text/plain; charset=UTF-8 Hey, Sorry for the late response. On Wed, Apr 25, 2012 at 1:36 AM, aaron morton wrote: > - Cassandra log reports 12,955,585 of them have been saved on the last save > events. > > Has their been much activity between saves ? For testing I set the key_cache_save_period to a short period of 10 minutes. How would this affect the result? Does saving the cache also prunes duplicate in-memory elements? > Nothing jumps out. There is a setting for the max entries to store, but this > only applies to the row cache. Can you reproduce issue in a dev environment > ? So far I haven't been able to reproduce this in development environment. > When running the key cache holds keys of the form so > there is an entry for each SSTable the key appears in. When saved only the > DecoratedKey's are stored, and the key cache is rebuilt on startup when > iterating over the index files. e.g. ig you have 12 entries in the keycache, > it may only be 4 unique keys and that is all that is written when saving the > cache. If you have 12 entries for the same key on 12 sstables, this means your data is spread across 12 sstables, how could cassandra deduplicate them to 4? I'll try to reproduce/debug it as well. Thanks, Omid > > From a quick look at the code it looks like the code is writing all > DecoratedKeys , not just the unique ones. This may be mucking up the > reported numbers, I'll take a look later. > > If you can reproduce it simply it would help. > > Cheers > > ----------------- > Aaron Morton > Freelance Developer > @aaronmorton > http://www.thelastpickle.com > > On 25/04/2012, at 1:11 AM, Omid Aladini wrote: > > Hi, > > I'm experiencing losing a part of key cache on restart on Cassandra 1.0.7. > For example: > > - cfstats reports key cache size of 13,040,502 with capacity of 15,000,000. > - Cassandra log reports 12,955,585 of them have been saved on the last save > events. > - On restart Cassandra reads saved cache. > - cfstats reports key cache size of only 2,833,586 with correct capacity of > 15,000,000. > > There is no sign that the cache size is reduced due to memory pressure. The > key cache capacity is set manually via cassandra-cli. > > Has anyone else encountered this problem or is it a known issue? > > Thanks, > Omid > >