[PR-4]Decision making module for automatic migration#793
Conversation
|
Thanks. Please rebase before requesting a review. |
844fc98 to
6a10160
Compare
|
Please check that the comments describing this PR are correct (all the PR's mentioned there have been closed, so I assume it's out of date). |
|
Review comment fix from PR #745:
|
|
@VenuReddy2103 , I have handled all review comments from PR #745. Please have a look. |
|
@AmitRoushan I still cannot review this PR until #794 , #795 and #796 have been reviewed. And I can't review those until #794 (comment) has been answered. So basically all of these PR's are blocked. |
524c65f to
9d17cca
Compare
4ffa543 to
9b5a943
Compare
9b5a943 to
74c7010
Compare
|
@quinton-hoole |
|
|
||
| // Register against OMS | ||
| ServerInfo srvInfo = createServerInfo(host, ksArgs.labels); | ||
| srvInfo.processorCount = Runtime.getRuntime().availableProcessors(); |
There was a problem hiding this comment.
It's not clear to me why this initialization is not done in createServerInfo like all the other initialization?
Or better still, in the constructor of ServerInfo?
I'm uncomfortable with having an uninitialized processorCount in ServerInfo structure until someone remembers to initialize it.
| } catch (Exception e) { | ||
| logger.warning("Failed to get replica dispatcher"); | ||
| e.printStackTrace(); | ||
| return false; |
There was a problem hiding this comment.
It seems it would be more appropriate to throw an exception here.
What does the return value of this method actually mean?
| } catch (MicroServiceNotFoundException e) { | ||
| logger.warning( | ||
| String.format( | ||
| "Skipping Replica [%s] evaluation as micro service not available", |
There was a problem hiding this comment.
Lets improve this exception message. It's not the microservice that's unavailable. It's not found in OMS.
| } catch (MicroServiceReplicaNotFoundException e) { | ||
| logger.warning( | ||
| String.format( | ||
| "Skipping Replica [%s] evaluation as micro service replica not available", |
| KernelServerNotFoundException { | ||
| /* | ||
| To measure time consumption by vertex Vk we use the following formula | ||
| tk = Tk,posk+i + summation { (Ski+Sik)/Rposk,posi + Lposk,posi } |
There was a problem hiding this comment.
Please explain what all these terms mean. tK, Tk, posk+i, Ski, Sik, Rposk? It's not at all clear what you mean here.
| serverManager.getKernelServerMetric(replicaKernelServer); | ||
|
|
||
| // get metrics stat of RPC processing time from different kernel client | ||
| // TODO currently considering processing time from different kernel client for simplicity. |
There was a problem hiding this comment.
Please clarify. It's not clear what you mean here.
| // calculate time factor impact on RPC with latency and bandwidth | ||
| long averageExecutionTime = 0; | ||
| long summation = 0; | ||
| long data; |
There was a problem hiding this comment.
Please call this dataSize. It's not data.
|
|
||
| // calculate time factor impact on RPC with latency and bandwidth | ||
| long averageExecutionTime = 0; | ||
| long summation = 0; |
There was a problem hiding this comment.
This is not a useful variable name. Do you mean the sum of the round trip times? Perhaps call it rttSum?
| } | ||
|
|
||
| AbstractMap.SimpleEntry<InetSocketAddress, Long> bestTimeOptimization = | ||
| predictedTime.first(); |
There was a problem hiding this comment.
I think it would be worth mentioning in a comment that you're relying on this set being sorted by time here. Sets are not usually sorted, so this is an unusual use of a set, and a bit confusing.
| replicaMetrics = microServiceManager.getMicroServiceMetric(replicaID); | ||
| } catch (MicroServiceNotFoundException e) { | ||
| e.printStackTrace(); | ||
| return 0; |
There was a problem hiding this comment.
This exception should be thrown. This also answers my previous question above.
| currentKernelServerMetrics = serverManager.getKernelServerMetric(currentKernelServer); | ||
| futureKernelServerMetrics = serverManager.getKernelServerMetric(futureKernelServer); | ||
| } catch (KernelServerNotFoundException e) { | ||
| e.printStackTrace(); |
There was a problem hiding this comment.
Throw this exception.
| return bestTimeOptimization.getKey(); | ||
| } | ||
|
|
||
| private long getOptimizedTime( |
There was a problem hiding this comment.
Add a comment to explain what this method does.
| return bestTimeOptimization.getKey(); | ||
| } | ||
|
|
||
| private long getOptimizedTime( |
There was a problem hiding this comment.
nit: It's not actually an optimization, it's a prediction of elapsed time on a different node.
| private long getOptimizedTime( | ||
| ReplicaID replicaID, | ||
| InetSocketAddress currentKernelServer, | ||
| InetSocketAddress futureKernelServer) |
There was a problem hiding this comment.
nit: It's not actually a future kernel server. It's a prediction related to an potential alternative kernel server.
| kernelClient, | ||
| futureKernelServer, | ||
| currentByteExchanged); | ||
| } catch (Exception e) { |
There was a problem hiding this comment.
We can't just catch Exceptions and ignore them like this.
| long currentProcessingTime; | ||
| long currentByteExchanged; | ||
| long futureProcessingTime; | ||
| double currentIOTime; |
There was a problem hiding this comment.
Lets avoid all double precision arithmetic. It's unnecessary. Just record times in a small enough unit (e.g. microseconds or nanoseconds) and just use integer arithmetic.
| "Node metric not available between kernel client [%s] and kernel server [%s]", | ||
| kernelClient, KernelServer); | ||
| logger.warning(msg); | ||
| throw new Exception(msg); |
There was a problem hiding this comment.
Please throw a more specific exception type. This is a not found exception.
| /* Store these metrics to make them available for statistics and decision making module */ | ||
| updateMetric(object.replicaId, object.metrics); | ||
| return; | ||
| } else if (notification instanceof MigrationNotification) { |
There was a problem hiding this comment.
I still don't understand why we're using notifications for all of these things.
Surely we should just have a method to receive metrics, and another one to receive migration instructions?
What's the benefit of using Notifications instead?
quinton-hoole
left a comment
There was a problem hiding this comment.
See inline comments for requested changes. Amit, if you are otherwise occupied, I can make the required changes. Let me know.
7ed595b to
4fbea74
Compare
|
@quinton-hoole |
|
Thanks Amit
…On Mon, Sep 9, 2019, 04:57 Amit Roushan ***@***.***> wrote:
@quinton-hoole <https://github.com/quinton-hoole>
I have fixed most of review comments but still i need some more time to
run some test scenario for migration.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#793?email_source=notifications&email_token=AKNAA6H25X3YXZABUOV67MLQIY2Y3A5CNFSM4HSZF2U2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6HJGPY#issuecomment-529437503>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AKNAA6AQPSFU42J76OXHWHDQIY2Y3ANCNFSM4HSZF2UQ>
.
|
|
|
||
| public ServerInfo(InetSocketAddress addr) { | ||
| this.host = addr; | ||
| this.processorCount = Runtime.getRuntime().availableProcessors(); |
There was a problem hiding this comment.
This will only work correctly when this constructor is called on the machine to which the server info refers. Surely processorCount should be a parameter to the constructor, similar to addr?
| private TreeSet<AbstractMap.SimpleEntry<ReplicaID, Long>> replicaHeap; | ||
| private TreeSet<AbstractMap.SimpleEntry<ReplicaID, Long>> | ||
| replicaHeap; // should only used in getBestCandidates for selecting best microservice | ||
| // replica for migration |
There was a problem hiding this comment.
Nit - weird comment formatting. Use /* */ instead?
| String.format( | ||
| "Skipping Replica [%s] for migration as micro service not found", | ||
| bestCandidateReplicaId)); | ||
| e.printStackTrace(); |
There was a problem hiding this comment.
Why do you need to print the stack trace?
| String.format( | ||
| "Skipping Replica [%s] for migration as micro service replica not found", | ||
| bestCandidateReplicaId)); | ||
| e.printStackTrace(); |
| } | ||
|
|
||
| return averageExecutionTime + summation; | ||
| return avgElapsedTime + avgRtt; |
There was a problem hiding this comment.
This seems wrong. Don't you want to subtract the RTT from the elapsedTime to get the processing (computation) time? Also, a single inbound RPC may result in multiple "dowstream" outbound RPC's, some in serial, and some in parallel. Using the avgRtt here (even assuming your substract it as mentioned above) implies a single outbound RPC per inbound RPC, which is not correct? I think you need to keep track of the ratio of inbound:outbound (say 1:n) and subtract n times the avgRtt?
|
@AmitRoushan How is your testing going? |
6ce13b0 to
45045cf
Compare
45045cf to
abf7bdc
Compare
|
@AmitRoushan @VenuReddy2103 What is the status with this PR please? |
1 similar comment
|
@AmitRoushan @VenuReddy2103 What is the status with this PR please? |






PR has following changes:
class for periodically watch metric and call prediction module for top migration candidate
class for predict kernel server node for replica.
Note: