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 122EA200D68 for ; Thu, 28 Dec 2017 18:22:43 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 10588160C16; Thu, 28 Dec 2017 17:22:43 +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 561BF160C0C for ; Thu, 28 Dec 2017 18:22:42 +0100 (CET) Received: (qmail 88570 invoked by uid 500); 28 Dec 2017 17:22:41 -0000 Mailing-List: contact dev-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list dev@ignite.apache.org Received: (qmail 88558 invoked by uid 99); 28 Dec 2017 17:22:41 -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; Thu, 28 Dec 2017 17:22:41 +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 B05571807A3 for ; Thu, 28 Dec 2017 17:22:40 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.379 X-Spam-Level: ** X-Spam-Status: No, score=2.379 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id kl5uEmfmvmPP for ; Thu, 28 Dec 2017 17:22:39 +0000 (UTC) Received: from mail-lf0-f51.google.com (mail-lf0-f51.google.com [209.85.215.51]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 880315F19C for ; Thu, 28 Dec 2017 17:22:38 +0000 (UTC) Received: by mail-lf0-f51.google.com with SMTP id w196so27955600lff.5 for ; Thu, 28 Dec 2017 09:22:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:mime-version:to:from:subject:date:importance:in-reply-to :references; bh=Ly3ZiQfwPL54gRjOIMiPvkRFVbUFGzs3EkO5/T1SFc8=; b=gBinc/HF+syWIcB/7D2EFmu9101NXWGnFE0lgXsLprCqTDU1wnGDmAUJ1bTt+YunvL hxUZ8jyComWjPCHuuqws1r3LGJpn0fWG54YoBLA7cjJqRFJqMoK8OqTF4xhY/EI2LHPj VSMAMfLn5SMUKEnbDvMq08NYy+x7TCsBhBUhzpO9DjrM1Nj37UUy/mO1mJYMy41XM24Z TLcOL891myAEUNc/6J71CZnm498Z7ksxTbiQ9mWgt3WGnpAgjzCQzwhNpX1coNM77d72 3zTNzc7KnxFgghyL8RoK71KVofTlyYK5RWo/Zb0x9XFsnpRw9WPhf/R9pmx2aX5i3nBD UbmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:mime-version:to:from:subject:date :importance:in-reply-to:references; bh=Ly3ZiQfwPL54gRjOIMiPvkRFVbUFGzs3EkO5/T1SFc8=; b=LzcgrbcUsuHf5rW+MqjgnKie2rASFVsHoNVOH2F7IHKbt5f8aZPfGfRw8gV6ugMMTK I8XrbmftiYhREP2Nks71Hgv8tDXdNEHA9HrNZUBPkwPpFdAulkJ3xR3WaTqrKGN91pGo znrYdA6uSViFx9YXq4BAh4n3s1TMvApdWuo1RCO9hErADeuB5X1f/q5gzi4BW8CSxsLz FFMlrywFuup4YbnD/pC2yz+YrdKhKWvbMQuMnHvUJ+ToZcxslROKe4UENh2K2Chv6LDM Md2EWmrxxhfGWJ5rAG8Jin/GrCJU/Ct81j9tmfgxC67DAbGs0ohKhB4hAkY+5YBy1DWT n5Ug== X-Gm-Message-State: AKGB3mJ3CYjX83ttE9db4qVwmC93mCyy5zD+pEodvzNX14rcYZyNYs5/ 4k9ZxZ313JM8ymN3eE0/UVciUsMu X-Google-Smtp-Source: ACJfBov+NOXdI8ITXsHXetx51LJyO2deSkHspgxx2XKlsYSFz2km5AVcppvNA7+8KH33EkyLqBJTtw== X-Received: by 10.46.68.11 with SMTP id r11mr19217889lja.1.1514481752369; Thu, 28 Dec 2017 09:22:32 -0800 (PST) Received: from ?IPv6:::ffff:172.25.4.98? ([195.144.253.150]) by smtp.gmail.com with ESMTPSA id x84sm1493073lff.70.2017.12.28.09.22.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Dec 2017 09:22:31 -0800 (PST) Message-ID: <5a452857.57c7190a.94211.a641@mx.google.com> MIME-Version: 1.0 To: "dev@ignite.apache.org " From: Stanislav Lukyanov Subject: RE: Handling slashes in cache names Date: Thu, 28 Dec 2017 20:22:31 +0300 Importance: normal X-Priority: 3 In-Reply-To: <5a4114a7.a811190a.f01bc.e89f@mx.google.com> References: <5a4114a7.a811190a.f01bc.e89f@mx.google.com> Content-Type: multipart/alternative; boundary="_56ECF26A-1174-4113-B29D-54BA4AD02203_" archived-at: Thu, 28 Dec 2017 17:22:43 -0000 --_56ECF26A-1174-4113-B29D-54BA4AD02203_ Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Hi all , I=E2=80=99ve implemented an approach of encoding unsafe characters in the c= ache names for persistent storage directories. You can find it at https://g= ithub.com/gridgain/apache-ignite/tree/ignite-7264. How it works now is: 1) all characters outside of the [a-zA-Z0-9_-] class a= re replaced with their hex value (seems to be the easiest way); 2) a hash o= f the cache name is added at the end of the name to avoid case-insensitive = collisions. There is still a tiny chance of hitting two cache names that are equal igno= ring case which also have the same hash, but that=E2=80=99s really unlikely= . It seems that there are no complications with this approach. The cache name to directory mapping is like mycache -> cache-mycache-f19fd83d my/cool/cache -> cache-my2fcool2fcache my!@#$%^&()cache -> cache-my21402324255e262829cache-84ba3e99 Turns out the persistence is not the only place that doesn=E2=80=99t like s= pecial symbols in cache names =E2=80=93 I also got an exception from MBean = registration when creating a cache with =E2=80=98*=E2=80=99 or =E2=80=98?= =E2=80=99. Filed https://issues.apache.org/jira/browse/IGNITE-7334 for that= . Please let me know if you have any comments. Thanks, Stan From: Stanislav Lukyanov Sent: 25 =D0=B4=D0=B5=D0=BA=D0=B0=D0=B1=D1=80=D1=8F 2017 =D0=B3. 18:09 To: dev@ignite.apache.org=20 Subject: Handling slashes in cache names Hi all, I=E2=80=99m looking into https://issues.apache.org/jira/browse/IGNITE-7264,= and I need some guidance on what=E2=80=99s the best way to approach it. The problem is that cache names are not restricted, but if persistence is e= nabled the cache needs to have a corresponding directory on the file system= (=E2=80=9Ccache-=E2=80=A6=E2=80=9D) which can=E2=80=99t be created if the = cache name contains certain characters (or a reserved system name). A straightforward approach would be to check if a cache name is allowed on = the local system (e.g. via `Paths.get(name)`) and fail to create cache if i= t isn=E2=80=99t, but I=E2=80=99m a bit concerned with the consistency of th= e behavior (the same cache name be allowed on one system and not on another= ). I think a better way would be to replace special characters (say, all non-a= lphanumeric characters) with underscores in file names (not changing the ca= che configuration). Would this be OK? Are there any risks I=E2=80=99m not c= onsidering? WDYT? Thanks, Stan --_56ECF26A-1174-4113-B29D-54BA4AD02203_--