JiscMail Logo
Email discussion lists for the UK Education and Research communities

Help for GRIDPP-STORAGE Archives


GRIDPP-STORAGE Archives

GRIDPP-STORAGE Archives


GRIDPP-STORAGE@JISCMAIL.AC.UK


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

GRIDPP-STORAGE Home

GRIDPP-STORAGE Home

GRIDPP-STORAGE  April 2011

GRIDPP-STORAGE April 2011

Options

Subscribe or Unsubscribe

Subscribe or Unsubscribe

Log In

Log In

Get Password

Get Password

Subject:

Re: dpm-sql-spacetoken-replicate-hotfiles usage

From:

Alessandra Forti <[log in to unmask]>

Reply-To:

Alessandra Forti <[log in to unmask]>

Date:

Tue, 12 Apr 2011 10:19:55 +0100

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (185 lines)

Hi Sam,

>  Do you want me to package this up into a "list files with replicas>  2" util for you?

yes, since you have most of the  code already.....

thanks

cheers
alessandra

On 12/04/2011 10:12, Sam Skipsey wrote:
> On 12 April 2011 09:59, Alessandra Forti<[log in to unmask]>  wrote:
>> Hi Wahid,
>>
>> it doesn't replicate when --del is used (is it supposed to work?). I rerun
>> it without --del and with --verbose in this way it is making the copies.
>> Still I don't think it'll be enough, yesterday I had 2 problems
>>
>> 1) the same file was reuested 5000 times 2 copies were not enough
>> 2) reco jobs wreaked avoc with proddisk files
>>
>> Problem 2) means we need to integrate your tool with something that also
>> looks at the hotfiles list of the day and makes copies of those too.
>>
>> It be nice to know which files have more than one replica independently from
>> the space token. Do you know what mysql query or API one is supposed to use?
> select fileid, count(*) from cns_db.Cns_file_replica GROUP BY
> cns_db.Cns_file_replica.fileid
>
> will give you a list of fileid s and how many replicas exist for them.
>
> You could then do something like:
>
> def sfn_lookup(cc, fileid):
>          namelist = ['']
>          try:
>                  cc.execute('''
>   select parent_fileid, name from Cns_file_metadata where fileid  = %s
> '' % fileid)
>
>                  name = ''
>                  parent_fileid = 0L
>                  p = cc.fetchone()
>                  #handle zero results here by raising exception!!!
>                  (parent_fileid, name) = p #this gets the "head" of the namei
>                  namelist.append(str(name))
>                  while parent_fileid>  1:
>                          cc.execute('''select parent_fileid, name from
> Cns_file_metadata where Cns_file_metadata.fileid = %s''' %
> parent_fileid)
>                          (parent_fileid, name) = cc.fetchone()
>                          #the above fetchone() is a zero length tuple
> in the case of no results, so that should except?
>                          namelist.append(str(name))
>          except MySQLdb.Error, e:
>                  sys.exit("Error %d: %s" % (e.args[0], e.args[1]))
>                  #sys.exit (1)
>          namelist.reverse() #put entries in "right" order for joining together
>          return '/'.join(namelist)[1:] #and print dpns name (minus srm bits)
>
> to generate the dpns name for a particular fileid. (cc is a Cursor
> object from a MySQLdb Connection object)
>
> Do you want me to package this up into a "list files with replicas>
> 2" util for you?
>
> Sam
>
>> thanks
>>
>> cheers
>> alessandra
>>
>>
>> On 12/04/2011 09:52, Wahid Bhimji wrote:
>>
>> Hello
>>
>> I have version gridpp-dpm-tools-2.6.7.DPM174-1
>>
>> That's good.
>>
>> According to the output it only deleted 3 files because there were 3
>> replicas instead of 2. When I run it again it did nothing even though most
>> files have a single replica. I'm running without --del now.
>>
>> I am surprised it isn't working without the --del option.
>> If you use the --list option does it say that there are only one replica for
>> most of the files.
>> There is a --verbose option that gives slightly more output which may shed
>> some light.
>> I presume you have DPM_HOST, DPNS_HOST set?
>> Sorry you having troubles with it.
>> Wahid
>>
>> cheers
>> alessandra
>>
>> On 11/04/2011 17:28, Wahid Bhimji wrote:
>>
>> WAIT!
>>
>> This isn't really an answer to your question though and so likely to cause
>> confusion (!) For your answer you can skip down but I would read the first
>> bit as a warning.
>>
>> But I was just about to send a warning to the list about using this tool
>> with the --del option (interesting timing of your email).
>>
>> Basically (I have mentioned this before but maybe not stressed its
>> importance) there was a bug with the first version of my script that the
>> replicas it created were not permanent.
>>
>> This means that if:
>>
>> 1) You used an old version of the tool to make replicas AND
>>
>> 2) Your run either old or new version with --del to reduce the number (e.g.
>> from 3 to 2) AND
>>
>> 3) You run dpm-drain on a filesystem containing these replicas
>>
>> there is a risk of removing all the replicas.
>>
>> I want to write a tool to list if people have non-permanent replicas and to
>> mark them all permanent - so will send another post when I have done that.
>> But I just wanted to flag it here in case people are in this position.
>>
>> (If you do suspect you may have done this then let me know (and for
>> atlashotdisk) I can run an integrity check and if there are missing files I
>> can also mark them lost and they will be restored quite easily). To be clear
>> though - you need to have done all 3 above otherwise there is no problem.
>>
>> So to answer you actual question !
>>
>> If you have never used the tool before and use the latest version (which is
>> I think your actual question) then then:
>>
>> A) You do not need --del that just deletes from (e.g 3 to 2) so in your case
>> it will see there is not more than 2 and do nothing.
>>
>> B) The first time it will take a long time and so I would run it first
>> outside cron.
>>
>> C) Then once that is done it will only run on new files (those that do not
>> have 2 replicas in ATLASHOTDISK) so you can put it in a daily cron.
>>
>> Let me know if this is not clear
>>
>> (and apologies to anyone caught out by the above bug. It is actually easily
>> put right so do let me know if you are concerned and I will send out another
>> post with more details).
>>
>> Cheers
>>
>> Wahid
>>
>>
>> On 11 Apr 2011, at 17:04, Alessandra Forti wrote:
>>
>> Hi,
>>
>> I'm going to try this command
>>
>> dpm-sql-spacetoken-replicate-hotfiles --nreps=2 --st=ATLASHOTDISK --del
>>
>> I'm wondering how do I catch the new files though and how often can I run
>> it. Is it really something I can put in a cron job? Otherwise I'll go with
>> the normal list-hotfiles and replicate only those files that have>NNN
>> requests unless they have been already replicated.
>>
>> cheers
>>
>> alessandra
>>
>>
>>
>>
>>
>> The University of Edinburgh is a charitable body, registered in
>> Scotland, with registration number SC005336.
>>
>>

Top of Message | Previous Page | Permalink

JiscMail Tools


RSS Feeds and Sharing


Advanced Options


Archives

April 2024
March 2024
February 2024
January 2024
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004


JiscMail is a Jisc service.

View our service policies at https://www.jiscmail.ac.uk/policyandsecurity/ and Jisc's privacy policy at https://www.jisc.ac.uk/website/privacy-notice

For help and support help@jisc.ac.uk

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager