<issue_start><issue_comment>Title: Add support for AliEn OCDB time machine
username_0: When using, for instance:

    AliCDBManager *cdb = AliCDBManager::Instance();
    cdb->SetDefaultStorage("raw://");
    cdb->SetRun(277015);
    cdb->SetMaxDate(TTimeStamp(2017, 7, 1, 0, 0, 0));  // new feature

only OCDB files created no later than the given UTC date will be returned.

This feature ensures perfect reproducibility: by setting a certain date it will
be possible to:

* protect jobs from OCDB updates while they are running
* re-run jobs in the future using the exact same OCDB
<issue_comment>username_1: 0eef6a783152c1fc5a5a92e6a388ff4a7f39481a: approval required: 1 of @jgrosseo (<NAME>), @chiarazampolli (<NAME>), @qgp (<NAME>), @username_0 (<NAME>), @sawenzel (<NAME>), @ktf (<NAME>), @shahor02 (<NAME>)

_Comment with `+1` to approve and allow automatic merging,or with `+test` to run tests only. **Please comment on the pull request: [click here](https://github.com/alisw/AliRoot/pull/465) and comment at the bottom of the page.**_
<issue_comment>username_0: +test
fyi: @username_2 @chiarazampolli @mconcas
<issue_comment>username_1: 0eef6a783152c1fc5a5a92e6a388ff4a7f39481a: testing approved: will not be automatically merged; starting testing. If testing succeeds, merging will require further approval from 1 of @jgrosseo (<NAME>), @chiarazampolli (<NAME>), @qgp (<NAME>), @username_0 (<NAME>), @sawenzel (<NAME>), @ktf (<NAME>), @shahor02 (<NAME>)
<issue_comment>username_0: (If you spot something very wrong in this PR could you please let me know?)
<issue_comment>username_1: 0eef6a783152c1fc5a5a92e6a388ff4a7f39481a: tests OK, approval required for merging: 1 of @jgrosseo (<NAME>), @chiarazampolli (<NAME>), @qgp (<NAME>), @username_0 (<NAME>), @sawenzel (<NAME>), @ktf (<NAME>), @shahor02 (<NAME>)

_Comment with `+1` to merge. **Please comment on the pull request: [click here](https://github.com/alisw/AliRoot/pull/465) and comment at the bottom of the page.**_
<issue_comment>username_2: Hi Dario,

thanks for implementing this feature.

I just have a question: from the diff of AliCDBGrid.cxx it seems you have also added a check on the version number of the file for files with GuidToCreationTimestamp(o_guid->String()) < fMaxDate).
I thought (but I well may be wrong) that this check should have been already applied in somewhere else in the code in order to return the latest version of the file, which is done also when fMaxDate is not used.
But I may be wrong...

Cheers, Francesco
<issue_comment>username_0: you are right, but it is applied on the server side only.

Note that in case you don't use the "time machine" feature, the original AliEn find command is used with the original server-side version check optimization.

Does this clarify?
<issue_comment>username_2: Hi Dario,

thanks for the explanations. All clear now!
I did not know of the -y option of alien_find, sorry for the noise I created.

Cheers, Francesco
<issue_comment>username_0: +1

No noise at all. This option is quite ad-hoc and it took me a while to figure out what it did, so it's good to discuss it and have it documented somewhere!

Can you please open a JIRA (as usual) in case you want the feature to be backported to v5-08-13ze-cookdedx?