From oak-issues-return-60986-archive-asf-public=cust-asf.ponee.io@jackrabbit.apache.org Thu Apr 5 15:43:06 2018 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 [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 0A5E118064F for ; Thu, 5 Apr 2018 15:43:05 +0200 (CEST) Received: (qmail 81452 invoked by uid 500); 5 Apr 2018 13:43:03 -0000 Mailing-List: contact oak-issues-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: oak-dev@jackrabbit.apache.org Delivered-To: mailing list oak-issues@jackrabbit.apache.org Received: (qmail 81441 invoked by uid 99); 5 Apr 2018 13:43:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Apr 2018 13:43:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 11C2EC039E for ; Thu, 5 Apr 2018 13:43:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.511 X-Spam-Level: X-Spam-Status: No, score=-109.511 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id na-pUWkgv_D3 for ; Thu, 5 Apr 2018 13:43:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 4635E5F2F0 for ; Thu, 5 Apr 2018 13:43:01 +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 645DAE0237 for ; Thu, 5 Apr 2018 13:43:00 +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 18EE82561D for ; Thu, 5 Apr 2018 13:43:00 +0000 (UTC) Date: Thu, 5 Apr 2018 13:43:00 +0000 (UTC) From: "Amit Jain (JIRA)" To: oak-issues@jackrabbit.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (OAK-7389) Mongo/FileBlobStore does not update timestamp for already existing blobs 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/OAK-7389?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D164269= 41#comment-16426941 ]=20 Amit Jain commented on OAK-7389: -------------------------------- [~catholicon] Thanks using MongoBlob might be the problem. Regarding the id= in the update blob that was not set initially and was added later on in my= experimentation. [~tmueller] We don't use the old vs new paradigm in Oak as we did in Jackra= bbit (I think that was the plan initially). As we use the MarkSweepGarbageC= ollector to trigger GC for all BlobStoresDataStore and use the GarbageColle= ctableBlobStore interface to only get all chunk ids as well as deletes, the= timestamp update would be required. > Mongo/FileBlobStore does not update timestamp for already existing blobs > ------------------------------------------------------------------------ > > Key: OAK-7389 > URL: https://issues.apache.org/jira/browse/OAK-7389 > Project: Jackrabbit Oak > Issue Type: Bug > Components: blob > Affects Versions: 1.2.14, 1.4.20, 1.8.2, 1.6.11 > Reporter: Amit Jain > Assignee: Amit Jain > Priority: Critical > Fix For: 1.2.30 > > Attachments: OAK-7389-v1.patch > > > MongoBlobStore uses uses the {{insert}} call and ignores any exceptions w= hich means any existing value won't be updated. > {code:java} > @Override > protected void storeBlock(byte[] digest, int level, byte[] data) thro= ws IOException { > String id =3D StringUtils.convertBytesToHex(digest); > cache.put(id, data); > // Check if it already exists? > MongoBlob mongoBlob =3D new MongoBlob(); > mongoBlob.setId(id); > mongoBlob.setData(data); > mongoBlob.setLevel(level); > mongoBlob.setLastMod(System.currentTimeMillis()); > // TODO check the return value > // TODO verify insert is fast if the entry already exists > try { > getBlobCollection().insertOne(mongoBlob); > } catch (DuplicateKeyException e) { > // the same block was already stored before: ignore > } catch (MongoException e) { > if (e.getCode() =3D=3D DUPLICATE_KEY_ERROR_CODE) { > // the same block was already stored before: ignore > } else { > throw new IOException(e.getMessage(), e); > } > } > } > {code} > =C2=A0FileBlobStore also returns if there's a file already existing witho= ut updating the timestamp > {code:java} > @Override > protected synchronized void storeBlock(byte[] digest, int level, byte= [] data) throws IOException { > File f =3D getFile(digest, false); > if (f.exists()) { > return; > } > ......... > {code} > The above would cause data loss in DSGC if there are updates to the blob = blocks which are re-surrected (stored again at the time of DSGC) because th= e timestamp would never have been modified. > =C2=A0 > cc/ [~tmueller], [~mreutegg], [~chetanm], [~catholicon] -- This message was sent by Atlassian JIRA (v7.6.3#76005)