-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Last loc update #4
base: master
Are you sure you want to change the base?
Conversation
@@ -508,6 +508,10 @@ | |||
TSERV_SUMMARY_RETRIEVAL_THREADS("tserver.summary.retrieval.threads", "10", PropertyType.COUNT, | |||
"The number of threads on each tablet server available to retrieve" | |||
+ " summary data, that is not currently in cache, from RFiles."), | |||
TSERV_LASTLOCATION_UPDATE_TIME("tserver.lastlocation.update.time", "1000000", PropertyType.COUNT, | |||
"The time in between tservers update last lcoation of tablets."), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lcoation -> location
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
String address, ZooLock zooLock, TServerInstance lastLocation) { | ||
|
||
TabletMutator tablet = context.getAmple().mutateTablet(extent); | ||
if(dfv.getNumEntries() > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we passing this in and checking its number of entries?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is what previous functions used and was just copied over. I wasn't sure about the intentions but I agree that it is not needed.
@Override | ||
public void run() { | ||
//this was more for testing | ||
sleepUninterruptibly(10, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
try { | ||
//a pause in the action. this was taken from major compactor above | ||
sleepUninterruptibly(getConfiguration().getTimeInMillis(Property.TSERV_LASTLOCATION_UPDATE_DELAY), | ||
TimeUnit.MILLISECONDS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like the idea of sleep uninterruptibly here. Does this not imply that the tserver cannot be stopped until this timer is complete?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was done in major compactor for "Time a tablet server will sleep between checking which tablets need compaction". Just a small delay so it does not check right away. It might not be necessary.
@@ -2730,6 +2730,37 @@ public void updateTabletDataFile(long maxCommittedTime, FileRef newDatafile, Fil | |||
|
|||
} | |||
|
|||
public void updateLastLocation(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need method comments for updateLastLocation and needsLastUpdate
@@ -2730,6 +2730,37 @@ public void updateTabletDataFile(long maxCommittedTime, FileRef newDatafile, Fil | |||
|
|||
} | |||
|
|||
public void updateLastLocation(){ | |||
synchronized (timeLock) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why synchronize on timeLock. That is used for controlling access to persistedTime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was leftover past iterations of my testing. I suppose if I update perssitedTime inside updateLastLocation as you mentioned below it might be needed?
//will keep looking for a better way to check if a tablet is old and needs to be updated or not. In the mean time, this seems to work and the property can be adjusted. | ||
if (tabletTime.getAndUpdateTime() - t.tabletTime.getMetadataTime(persistedTime).getTime() >= tabletServer.getConfiguration().getCount(Property.TSERV_LASTLOCATION_UPDATE_TIME)) { | ||
//updat persisted time, maybe not needed | ||
persistedTime = tabletTime.getAndUpdateTime(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would think we would do this when we do the update, not when we are checking whether we are to update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only did it here since I pass in the updated persistedTime to updateLastLocation. I suppose it could be moved and simplify the check function.
TabletMutator tablet = context.getAmple().mutateTablet(extent); | ||
if(dfv.getNumEntries() > 0) { | ||
//these two lines might not be needed for updating the last location | ||
tablet.putFile(path, dfv); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What files are we changing? We are only changing the last location for the tablet, not the files. The time thing however may be needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I figured it wasn't needed but I did not want to break anything.
synchronized (timeLock) { | ||
Tablet t = tabletServer.getOnlineTablet(extent); | ||
SortedMap<FileRef, DataFileValue> sm = t.getDatafiles(); | ||
for (Map.Entry<FileRef, DataFileValue> m : sm.entrySet()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A for loop over the files does not seem right here. We only need to change the last location of the tablet once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be removed since I will not pass in dfv or fileref anymore.
@@ -2730,6 +2730,29 @@ public void updateTabletDataFile(long maxCommittedTime, FileRef newDatafile, Fil | |||
|
|||
} | |||
|
|||
public void updateLastLocation(){ | |||
//update persisted time, maybe not needed | |||
//persistedTime = tabletTime.getAndUpdateTime(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need this update now such that the persisted time is current.
|
||
Tablet tablet = entry.getValue(); | ||
//unsure if synchronized block is needed or not | ||
synchronized (tablet) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since we are updating the time stuff, I think this is required.
Add last_loc_update Add comments made requested changes made further revisions made further revisions changes for testing changes for testing final changes Add method comments
b75868a
to
3122c2d
Compare
…st_loc_test_update2
No description provided.