Skip to content
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

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open

Last loc update #4

wants to merge 34 commits into from

Conversation

ivakegg
Copy link
Owner

@ivakegg ivakegg commented Dec 9, 2019

No description provided.

@@ -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."),
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lcoation -> location

Copy link

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) {
Copy link
Owner Author

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?

Copy link

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,
Copy link
Owner Author

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);
Copy link
Owner Author

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?

Copy link

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(){
Copy link
Owner Author

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) {
Copy link
Owner Author

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.

Copy link

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();
Copy link
Owner Author

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.

Copy link

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);
Copy link
Owner Author

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.

Copy link

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()) {
Copy link
Owner Author

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.

Copy link

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();
Copy link
Owner Author

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) {
Copy link
Owner Author

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
@Manno15 Manno15 deleted the last_loc_update branch May 29, 2020 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants