From owner-svn-ports-all@freebsd.org Wed Oct 21 22:06:52 2015 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07D97A1BB4F; Wed, 21 Oct 2015 22:06:52 +0000 (UTC) (envelope-from wg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B847013A9; Wed, 21 Oct 2015 22:06:51 +0000 (UTC) (envelope-from wg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9LM6omq027012; Wed, 21 Oct 2015 22:06:50 GMT (envelope-from wg@FreeBSD.org) Received: (from wg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9LM6ofx027008; Wed, 21 Oct 2015 22:06:50 GMT (envelope-from wg@FreeBSD.org) Message-Id: <201510212206.t9LM6ofx027008@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wg set sender to wg@FreeBSD.org using -f From: William Grzybowski Date: Wed, 21 Oct 2015 22:06:50 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r399937 - in head/sysutils/riak-cs: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2015 22:06:52 -0000 Author: wg Date: Wed Oct 21 22:06:50 2015 New Revision: 399937 URL: https://svnweb.freebsd.org/changeset/ports/399937 Log: sysutils/riak-cs: update to 2.1.0 Submitted by: Scott Kamp Added: head/sysutils/riak-cs/files/patch-riak_test_src_downgrage_bitcask.erl (contents, props changed) Modified: head/sysutils/riak-cs/Makefile head/sysutils/riak-cs/distinfo head/sysutils/riak-cs/pkg-plist Modified: head/sysutils/riak-cs/Makefile ============================================================================== --- head/sysutils/riak-cs/Makefile Wed Oct 21 21:58:49 2015 (r399936) +++ head/sysutils/riak-cs/Makefile Wed Oct 21 22:06:50 2015 (r399937) @@ -1,7 +1,7 @@ # $FreeBSD$ PORTNAME= riak-cs -PORTVERSION= 2.0.1 +PORTVERSION= 2.1.0 CATEGORIES= sysutils MASTER_SITES= http://s3.amazonaws.com/downloads.basho.com/riak-cs/${PORTVERSION:R}/${PORTVERSION}/ \ http://downloads.basho.com.s3.amazonaws.com/riak-cs/${PORTVERSION:R}/${PORTVERSION}/ @@ -15,7 +15,6 @@ BUILD_DEPENDS= ${LOCALBASE}/lib/riak-erl USES= gmake readline USE_RC_SUBR= riak-cs -USE_GCC= yes USERS= riakcs GROUPS= riak Modified: head/sysutils/riak-cs/distinfo ============================================================================== --- head/sysutils/riak-cs/distinfo Wed Oct 21 21:58:49 2015 (r399936) +++ head/sysutils/riak-cs/distinfo Wed Oct 21 22:06:50 2015 (r399937) @@ -1,2 +1,2 @@ -SHA256 (riak-cs-2.0.1.tar.gz) = 7c8d38ff678c42271e51270bb9e82002358f8c2d15a071ae8e406d52655c64da -SIZE (riak-cs-2.0.1.tar.gz) = 9734438 +SHA256 (riak-cs-2.1.0.tar.gz) = 3a7a67069f170986f6275defe9e79c3b87937865e6c978eb7f7f97be3cf99360 +SIZE (riak-cs-2.1.0.tar.gz) = 10670941 Added: head/sysutils/riak-cs/files/patch-riak_test_src_downgrage_bitcask.erl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/riak-cs/files/patch-riak_test_src_downgrage_bitcask.erl Wed Oct 21 22:06:50 2015 (r399937) @@ -0,0 +1,140 @@ +diff -ruN temp/riak-cs-2.1.0/riak_test/src/downgrade_bitcask.erl work/riak-cs-2.1.0/riak_test/src/downgrade_bitcask.erl +--- temp/riak-cs-2.1.0/riak_test/src/downgrade_bitcask.erl 1970-01-01 10:00:00.000000000 +1000 ++++ riak_test/src/downgrade_bitcask.erl 2015-10-22 08:44:18.415188879 +1100 +@@ -0,0 +1,136 @@ ++% Run this script to downgrade Bitcask files from the format ++% introduced in Riak 2.0 to the format used in Riak 1.4 ++% Run it by calling escript on it and pointing it to a data ++% directory after stopping the Riak node. ++% The script will recursively find all Bitcask files under that ++% directory and reformat them. ++% $ escript downgrade_bitcask.erl /my/riak/data/bitcask ++-module(downgrade_bitcask). ++-mode(compile). ++-export([main/1]). ++ ++-define(HEADER_SIZE, 14). ++-record(entry, { crc, tstamp, keysz, valsz, key, val}). ++ ++main([DataDir]) -> ++ downgrade_if_dir(DataDir). ++ ++maybe_downgrade_file(F) -> ++ is_bitcask_file(F) andalso downgrade_file(F). ++ ++downgrade_if_dir(Dir) -> ++ case filelib:is_dir(Dir) of ++ true -> ++ downgrade_dir(Dir); ++ false -> ++ ok ++ end. ++ ++downgrade_dir(Dir) -> ++ {ok, Children0} = file:list_dir(Dir), ++ Children = [filename:join(Dir, Child) || Child <- Children0], ++ case is_bitcask_dir(Dir) of ++ false -> ++ [downgrade_if_dir(Child) || Child <- Children]; ++ true -> ++ [maybe_downgrade_file(Child) || Child <- Children] ++ end. ++ ++is_bitcask_file(Filename0) -> ++ Filename = filename:basename(Filename0), ++ Match = re:run(Filename, "^\\d+\\.bitcask\\.data$"), ++ nomatch =/= Match. ++ ++is_bitcask_dir(Dir) -> ++ case filelib:is_dir(Dir) of ++ false -> ++ false; ++ true -> ++ {ok, Files} = file:list_dir(Dir), ++ lists:any(fun is_bitcask_file/1, Files) ++ end. ++ ++read_entry(F) -> ++ case file:read(F, ?HEADER_SIZE) of ++ {ok, <>} -> ++ case file:read(F, KeySz+ValueSz) of ++ {ok, <>} -> ++ % io:format("K: ~p, V: ~p\n", [Key, Value]), ++ {ok, #entry{crc=CRC, tstamp=Tstamp, keysz=KeySz, valsz=ValueSz, ++ key=Key, val=Value}}; ++ _ -> ++ error ++ end; ++ eof -> ++ eof; ++ _ -> ++ io:format("Error reading entry\n"), ++ error ++ end. ++ ++downgrade_file(F) -> ++ Dir = filename:dirname(F), ++ NewF = F ++ ".new", ++ HintFile = filename:join(Dir, filename:basename(F, ".data")++".hint"), ++ NewHF = HintFile ++ ".new", ++ io:format("Downgrading file ~s\n", [F]), ++ {ok, Fi} = file:open(F, [read, raw, binary]), ++ {ok, Fo} = file:open(NewF, [write, raw, binary]), ++ {ok, Fh} = file:open(NewHF, [write, raw, binary]), ++ ok = convert_file(Fi, Fo, Fh, 0, 0, fun tx_pre_20/1), ++ ok = file:close(Fi), ++ ok = file:close(Fo), ++ ok = file:close(Fh), ++ HintBak = HintFile ++ ".bak", ++ FBak = F ++ ".bak", ++ ok = file:rename(HintFile, HintBak), ++ ok = file:rename(F, FBak), ++ ok = file:rename(NewF, F), ++ ok = file:rename(NewHF, HintFile), ++ ok = file:delete(HintBak), ++ ok = file:delete(FBak), ++ ok. ++ ++convert_file(Fi, Fo, Fh, Ofs, Crc, Tx) -> ++ case read_entry(Fi) of ++ {ok, Entry} -> ++ NewEntry = Tx(Entry), ++ Sz = write_entry(Fo, NewEntry), ++ NewCrc = write_hint_entry(Fh, Ofs, Sz, Crc, NewEntry), ++ convert_file(Fi, Fo, Fh, Ofs+Sz, NewCrc, Tx); ++ eof -> ++ write_hint_entry(Fh, 16#ffffFFFFffffFFFF, Crc, 0, ++ #entry{key= <<>>, tstamp=0}), ++ % io:format("Finished reading file\n", []), ++ ok; ++ _ -> ++ io:format(standard_error, "Error reading file\n", []), ++ error ++ end. ++ ++write_hint_entry(F, Ofs, Sz, Crc, #entry{key=Key, tstamp=Tstamp}) -> ++ KeySz = size(Key), ++ Hint = [<>, Key], ++ ok = file:write(F, Hint), ++ erlang:crc32(Crc, Hint). ++ ++write_entry(F, #entry {key=Key, val=Value, tstamp=Tstamp}) -> ++ KeySz = size(Key), ++ ValueSz = size(Value), ++ Bytes0 = [<>, <>, <>, Key, Value], ++ Bytes = [<<(erlang:crc32(Bytes0)):32>> | Bytes0], ++ ok = file:write(F, Bytes), ++ iolist_size(Bytes). ++ ++tx_pre_20(Entry = ++ #entry{key= <<2, BucketSz:16, Bucket:BucketSz/binary, ++ Key/binary>>}) -> ++ OldKey=term_to_binary({Bucket, Key}), ++ % io:format("Converted B/K ~s/~s\n", [Bucket, Key]), ++ tx_pre_20(Entry#entry{key=OldKey, keysz=size(OldKey)}); ++tx_pre_20(Entry= ++ #entry{val= <<"bitcask_tombstone2", _/binary>>}) -> ++ NewVal = <<"bitcask_tombstone">>, ++ Entry#entry{val=NewVal, valsz=size(NewVal)}; ++tx_pre_20(Entry) -> ++ Entry. Modified: head/sysutils/riak-cs/pkg-plist ============================================================================== --- head/sysutils/riak-cs/pkg-plist Wed Oct 21 21:58:49 2015 (r399936) +++ head/sysutils/riak-cs/pkg-plist Wed Oct 21 22:06:50 2015 (r399937) @@ -6,6 +6,7 @@ sbin/riak-cs-gc sbin/riak-cs-multibag sbin/riak-cs-stanchion sbin/riak-cs-storage +sbin/riak-cs-supercluster @sample %%RIAKCS_CONFDIR%%/riak-cs.conf @sample %%RIAKCS_CONFDIR%%/advanced.config @sample %%RIAKCS_CONFDIR%%/key.pem