Skip to content

Commit

Permalink
pool: report correct replica creation time to sweeper
Browse files Browse the repository at this point in the history
Motivation:

Sweeper ls command shows two timestamps - replica creation time and
last access time. Replica creation time is incorrect - it shows either
replica creation time or pool start up time (whicever is more recent).

Modification:

Set creation time properly when repository loads.

Result:

Correct replica creation time displayed by sweeper ls

	Patch: https://rb.dcache.org/r/11538/
	Target: master
	Request: 5.0
	Request: 4.2

	Acked-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
	Require-book: no
	Require-notes: yes
  • Loading branch information
DmitryLitvintsev committed Feb 14, 2019
1 parent fab3885 commit 121a95c
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public class CacheRepositoryEntryImpl implements ReplicaRecord

private final PnfsId _pnfsId;
private final AbstractBerkeleyDBReplicaStore _repository;
private final long _creationTime;

/**
* Sticky records held by the file.
Expand All @@ -60,8 +61,6 @@ public class CacheRepositoryEntryImpl implements ReplicaRecord

private ReplicaState _state;

private long _creationTime = System.currentTimeMillis();

private long _lastAccess;

private int _linkCount;
Expand All @@ -74,6 +73,7 @@ public CacheRepositoryEntryImpl(AbstractBerkeleyDBReplicaStore repository, PnfsI
_pnfsId = pnfsId;
_state = NEW;
_sticky = ImmutableList.of();
_creationTime = System.currentTimeMillis();
_lastAccess = _creationTime;
}

Expand All @@ -85,6 +85,7 @@ public CacheRepositoryEntryImpl(AbstractBerkeleyDBReplicaStore repository, PnfsI
_state = state;
setStickyRecords(sticky);
_lastAccess = attributes.lastModifiedTime().toMillis();
_creationTime = attributes.creationTime().toMillis();
_size = attributes.size();
}

Expand Down Expand Up @@ -120,11 +121,6 @@ public synchronized int getLinkCount()
return _linkCount;
}

public synchronized void setCreationTime(long time)
{
_creationTime = time;
}

@Override
public synchronized long getCreationTime()
{
Expand Down

0 comments on commit 121a95c

Please sign in to comment.