[CELEBORN-1215][FOLLOWUP] Improve PausePushDataTime and PausePushDataAndReplicateTime metric calculation logic #3069
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
As title, improve PausePushDataTime、PausePushDataAndReplicateTime、pausePushDataCounter metric calculation logic.
Why are the changes needed?
During a stress test, it was found that the
pausePushDataAndReplicateTime
metric value was 55.1 years, which is obviously abnormal. As shown in the figure below.The reason is as follows:
In the process of
ServingState
transition:NONE PAUSED
->PAUSE PUSH
->PAUSE PUSH AND REPLICATE
The
pausePushDataAndReplicateStartTime
was not correctly assigned.When
trimCounter >= forceAppendPauseSpentTimeThreshold
orServingState
changes fromPAUSE PUSH AND REPLICATE
->NONE PAUSED
, theappendPauseSpentTime
method is executed to updatepausePushDataAndReplicateTime
.The execution logic is
pausePushDataAndReplicateTime += System.currentTimeMillis() - -1L
, which will be displayed as 55.1 years. System.currentTimeMillis()/1000/3600/24/365.Similarly, in the process of
ServingState
transition:NONE PAUSED
->PAUSE PUSH AND REPLICATE
->PAUSE PUSH
, thepausePushDataStartTime
was not correctly assigned.When
trimCounter >= forceAppendPauseSpentTimeThreshold
orServingState
changes fromPAUSE PUSH
->NONE PAUSED
, theappendPauseSpentTime
method is executed to updatepausePushDataTime
, which will be displayed as 55.1 years.Modify the logic of
pausePushDataCounter
:The
PAUSE PUSH AND REPLICATE
state includes the worker stopping receiving pushData.Therefore:
When
NONE PAUSED
->PAUSE PUSH AND REPLICATE
:pausePushDataCounter
needs to be increased.When
PAUSE PUSH AND REPLICATE
->PAUSE PUSH
:pausePushDataCounter
does not need to be increased.Does this PR introduce any user-facing change?
NO
How was this patch tested?
Celeborn Dashboard
MemoryManagerSuite#[CELEBORN-882] Test MemoryManager check memory thread logic