David Glasser wrote on Mon, 12 Oct 2009 at 16:54 -0700:
> I'm not clear on what exactly the data it prints is supposed to
> represent. As implemented, it appears to be "the amount of
> rep-sharing possible on this repository, if it had been entirely
> written to in a world where rep-sharing exists". Is that what you
> mean to have? Or are you trying to calculate how much rep-sharing is
> actually accomplishing in the repository you're looking at?
>
True, I compute the former but intended the latter. I neglected to
check whether two reps with matching sha1's are also shared on disk. In
other words, I should key the hashes on (rev file, offset) tuples rather
than on the sha1.
> Also, I'm not really sure that casting unsigned int<->void* is
> technically well-defined.
>
Was trying to avoid malloc'ing an unsigned int. But, indeed, I can't
find a reference allowing the cast. So I have two options:
* malloc an unsigned int
* use pointer arithmetic:
def increment():
void *p = apr_hash_get();
apr_hash_set(p+1)
def extract_final_value():
void *p = apr_hash_get();
return (p - NULL)
I'll go with the first option :)
> --dave
>
Thanks for the eyes,
Daniel
> On Mon, Oct 12, 2009 at 3:36 PM, Daniel Shahaf <d.s_at_daniel.shahaf.name> wrote:
> > Recently I added svn-rep-sharing-stats to the repository [1]. (It aims to
> > be a tool for calculating reference counts for representations in an FSFS
> > repository.)
> >
> > Since I'm not an FSFS expert, and wrote it partly based on the APIs and
> > partly based on "doing it this way seems to work", I'll appreciate
> > having some review on it.
> >
> > (What can go wrong? Anything, I suppose, from FS corruption bugs to
> > simple "doesn't calculate the refcounts correctly" bugs.)
> >
> > Most of the logic is in the functions process() and especially
> > process_one_revision().
> >
> > Thanks.
> >
> > Daniel
> > (who considers copying fsfs-reshard.py's always-on "This isn't ready to be
> > used on live data" warning)
> >
> > [1] http://svn.collab.net/repos/svn/trunk/tools/server-side/svn-rep-sharing-stats.c
> >
> > ------------------------------------------------------
> > http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2406831
> >
>
>
>
>
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2406885
Received on 2009-10-13 23:48:00 CEST