You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@celeborn.apache.org by "SteNicholas (via GitHub)" <gi...@apache.org> on 2024/11/07 09:52:45 UTC
[PR] [CELEBORN-1685] ShuffleFallbackPolicy supports ShuffleFallbackCount metric [celeborn]
SteNicholas opened a new pull request, #2891:
URL: https://github.com/apache/celeborn/pull/2891
### What changes were proposed in this pull request?
`ShuffleFallbackPolicy` supports `ShuffleFallbackCount` metric to provide the shuffle fallback count of each fallback policy.
### Why are the changes needed?
The implementations of `ShuffleFallbackPolicy` does not support `ShuffleFallbackCount` metric at present. Meanwhile, Bilibili production practice needs `ShuffleFallbackCount` of different `ShuffleFallbackPolicy`.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Cluster test.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@celeborn.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CELEBORN-1685] ShuffleFallbackPolicy supports ShuffleFallbackCount metric [celeborn]
Posted by "SteNicholas (via GitHub)" <gi...@apache.org>.
SteNicholas commented on PR #2891:
URL: https://github.com/apache/celeborn/pull/2891#issuecomment-2462076778
Ping @turboFei, @FMX, @RexXiong.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@celeborn.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CELEBORN-1685] ShuffleFallbackPolicy supports ShuffleFallbackCount metric [celeborn]
Posted by "turboFei (via GitHub)" <gi...@apache.org>.
turboFei commented on code in PR #2891:
URL: https://github.com/apache/celeborn/pull/2891#discussion_r1833766003
##########
assets/grafana/celeborn-dashboard.json:
##########
@@ -1544,6 +1544,94 @@
"sort": "none"
}
},
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "expr": "metrics_ShuffleTotalCount_Value{instance=~\"${instance}\"}",
Review Comment:
seems typo, no `fallback` keywords in the expr
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@celeborn.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CELEBORN-1685] ShuffleFallbackPolicy supports ShuffleFallbackCount metric [celeborn]
Posted by "turboFei (via GitHub)" <gi...@apache.org>.
turboFei commented on code in PR #2891:
URL: https://github.com/apache/celeborn/pull/2891#discussion_r1833777808
##########
assets/grafana/celeborn-dashboard.json:
##########
@@ -1472,7 +1472,7 @@
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
- "description": "The count of shuffle fallbacks.",
+ "description": "The total count of shuffle.",
Review Comment:
Seems the `shuffle` count including both celeborn shuffle and spark built-in shuffle, we need to enhance the description to make it more clear
##########
common/src/main/scala/org/apache/celeborn/common/protocol/message/ControlMessages.scala:
##########
@@ -1208,11 +1211,16 @@ object ControlMessages extends Logging {
case HEARTBEAT_FROM_APPLICATION_VALUE =>
val pbHeartbeatFromApplication = PbHeartbeatFromApplication.parseFrom(message.getPayload)
+ val shuffleFallbackCountMap = new util.HashMap[String, java.lang.Long]()
+ pbHeartbeatFromApplication.getShuffleFallbackCountsMap.asScala.foreach { entry =>
Review Comment:
I have a question:
If I use old celeborn client, will the `getShuffleFallbackCountsMap` be `null`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@celeborn.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CELEBORN-1685] ShuffleFallbackPolicy supports ShuffleFallbackCount metric [celeborn]
Posted by "turboFei (via GitHub)" <gi...@apache.org>.
turboFei commented on code in PR #2891:
URL: https://github.com/apache/celeborn/pull/2891#discussion_r1833835019
##########
master/src/main/scala/org/apache/celeborn/service/deploy/master/Master.scala:
##########
@@ -261,8 +261,20 @@ private[celeborn] class Master(
}).sum()
}
+ masterSource.addGauge(MasterSource.SHUFFLE_TOTAL_COUNT) { () =>
+ statusSystem.shuffleTotalCount.sum()
+ }
+
masterSource.addGauge(MasterSource.SHUFFLE_FALLBACK_COUNT) { () =>
- statusSystem.shuffleTotalFallbackCount.sum()
+ statusSystem.shuffleFallbackCounts.values().asScala.map(_.longValue()).sum
+ }
+
+ statusSystem.shuffleFallbackCounts.entrySet().asScala.foreach { shuffleFallbackCount =>
Review Comment:
seems we can register metrics on demand when add new key into the map
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@celeborn.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CELEBORN-1685] ShuffleFallbackPolicy supports ShuffleFallbackCount metric [celeborn]
Posted by "turboFei (via GitHub)" <gi...@apache.org>.
turboFei commented on code in PR #2891:
URL: https://github.com/apache/celeborn/pull/2891#discussion_r1833766003
##########
assets/grafana/celeborn-dashboard.json:
##########
@@ -1544,6 +1544,94 @@
"sort": "none"
}
},
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "expr": "metrics_ShuffleTotalCount_Value{instance=~\"${instance}\"}",
Review Comment:
seems typo, no `fallback` keywords in the expr
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@celeborn.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CELEBORN-1685] ShuffleFallbackPolicy supports ShuffleFallbackCount metric [celeborn]
Posted by "turboFei (via GitHub)" <gi...@apache.org>.
turboFei commented on code in PR #2891:
URL: https://github.com/apache/celeborn/pull/2891#discussion_r1833810707
##########
client/src/main/scala/org/apache/celeborn/client/ApplicationHeartbeater.scala:
##########
@@ -59,18 +59,21 @@ class ApplicationHeartbeater(
override def run(): Unit = {
try {
require(masterClient != null, "When sending a heartbeat, client shouldn't be null.")
- val ((tmpTotalWritten, tmpTotalFileCount), tmpShuffleFallbackCount) = shuffleMetrics()
+ val (
+ (tmpTotalWritten, tmpTotalFileCount),
+ (tmpShuffleCount, tmpShuffleFallbackCounts)) = shuffleMetrics()
logInfo("Send app heartbeat with " +
s"written: ${Utils.bytesToString(tmpTotalWritten)}, file count: $tmpTotalFileCount, " +
- s"shuffle fallback count: $tmpShuffleFallbackCount")
+ s"shuffle count: $tmpShuffleCount, shuffle fallback count: $tmpShuffleFallbackCounts")
Review Comment:
nit:
```
shuffle fallback counts:
```
##########
client/src/main/scala/org/apache/celeborn/client/LifecycleManager.scala:
##########
@@ -210,7 +211,10 @@ class LifecycleManager(val appUniqueId: String, val conf: CelebornConf) extends
appUniqueId,
conf,
masterClient,
- () => commitManager.commitMetrics() -> shuffleFallbackCount.sumThenReset(),
+ () =>
+ commitManager.commitMetrics() ->
+ (shuffleCount.sumThenReset(),
+ shuffleFallbackCounts.asScala.filter(_._2 > 0L).toMap),
Review Comment:
we need to reset the `shuffleFallbackCounts` after get values
##########
master/src/main/scala/org/apache/celeborn/service/deploy/master/Master.scala:
##########
@@ -261,8 +261,20 @@ private[celeborn] class Master(
}).sum()
}
+ masterSource.addGauge(MasterSource.SHUFFLE_TOTAL_COUNT) { () =>
+ statusSystem.shuffleTotalCount.sum()
+ }
+
masterSource.addGauge(MasterSource.SHUFFLE_FALLBACK_COUNT) { () =>
- statusSystem.shuffleTotalFallbackCount.sum()
+ statusSystem.shuffleFallbackCounts.values().asScala.map(_.longValue()).sum
+ }
+
+ statusSystem.shuffleFallbackCounts.entrySet().asScala.foreach { shuffleFallbackCount =>
Review Comment:
If the initial `shuffleFallbackCounts` is empty, it will not register the gauge metrics
##########
master/src/main/scala/org/apache/celeborn/service/deploy/master/Master.scala:
##########
@@ -261,8 +261,20 @@ private[celeborn] class Master(
}).sum()
}
+ masterSource.addGauge(MasterSource.SHUFFLE_TOTAL_COUNT) { () =>
+ statusSystem.shuffleTotalCount.sum()
+ }
+
masterSource.addGauge(MasterSource.SHUFFLE_FALLBACK_COUNT) { () =>
- statusSystem.shuffleTotalFallbackCount.sum()
+ statusSystem.shuffleFallbackCounts.values().asScala.map(_.longValue()).sum
+ }
+
+ statusSystem.shuffleFallbackCounts.entrySet().asScala.foreach { shuffleFallbackCount =>
Review Comment:
how to register metrics during runtime?
##########
master/src/main/scala/org/apache/celeborn/service/deploy/master/MasterSource.scala:
##########
@@ -55,6 +55,7 @@ object MasterSource {
val ACTIVE_SHUFFLE_FILE_COUNT = "ActiveShuffleFileCount"
+ val SHUFFLE_TOTAL_COUNT = "ShuffleTotalCount"
Review Comment:
how about adding comments in the code as well?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@celeborn.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CELEBORN-1685] ShuffleFallbackPolicy supports ShuffleFallbackCount metric [celeborn]
Posted by "turboFei (via GitHub)" <gi...@apache.org>.
turboFei commented on code in PR #2891:
URL: https://github.com/apache/celeborn/pull/2891#discussion_r1835170347
##########
master/src/main/scala/org/apache/celeborn/service/deploy/master/Master.scala:
##########
@@ -1095,22 +1101,35 @@ private[celeborn] class Master(
}
}
+ private def gaugeShuffleFallbackCounts(): Unit = {
+ statusSystem.shuffleFallbackCounts.entrySet().asScala.foreach { shuffleFallbackCount =>
+ masterSource.addGauge(
+ MasterSource.SHUFFLE_FALLBACK_COUNT,
+ Map("fallbackPolicy" -> shuffleFallbackCount.getKey)) { () =>
+ shuffleFallbackCount.getValue
Review Comment:
I think it is better to get the entry by key during runtime, in case the entry is cleaned likes Statemachine.reinitialize, not sure.
```
Option(statusSystem.shuffleFallbackCounts.get(shuffleFallbackCount.getKey)).getOrElse(0)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@celeborn.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CELEBORN-1685] ShuffleFallbackPolicy supports ShuffleFallbackCount metric [celeborn]
Posted by "RexXiong (via GitHub)" <gi...@apache.org>.
RexXiong commented on code in PR #2891:
URL: https://github.com/apache/celeborn/pull/2891#discussion_r1833616602
##########
common/src/main/proto/TransportMessages.proto:
##########
@@ -443,6 +443,7 @@ message PbHeartbeatFromApplication {
repeated PbWorkerInfo needCheckedWorkerList = 5;
bool shouldResponse = 6;
int64 shuffleFallbackCount = 7;
+ map<string, int64> shuffleFallbackCounts = 8;
Review Comment:
We can change to totalShuffleCount
##########
client-spark/spark-3/src/main/scala/org/apache/spark/shuffle/celeborn/CelebornShuffleFallbackPolicyRunner.scala:
##########
@@ -35,12 +37,25 @@ class CelebornShuffleFallbackPolicyRunner(conf: CelebornConf) extends Logging {
def applyFallbackPolicies[K, V, C](
dependency: ShuffleDependency[K, V, C],
lifecycleManager: LifecycleManager): Boolean = {
- val needFallback =
- shuffleFallbackPolicies.exists(_.needFallback(dependency, conf, lifecycleManager))
- if (needFallback && FallbackPolicy.NEVER.equals(shuffleFallbackPolicy)) {
- throw new CelebornIOException(
- "Fallback to spark built-in shuffle implementation is prohibited.")
+ val fallbackPolicy =
Review Comment:
Could you also add a total shuffle count metric?
##########
master/src/main/java/org/apache/celeborn/service/deploy/master/clustermeta/AbstractMetaManager.java:
##########
@@ -550,4 +561,19 @@ public void removeApplicationMeta(String appId) {
public int registeredShuffleCount() {
return registeredAppAndShuffles.values().stream().mapToInt(Set::size).sum();
}
+
+ private void addShuffleFallbackCounts(Map<String, Long> fallbackCounts) {
+ for (String fallbackPolicy : fallbackCounts.keySet()) {
+ shuffleFallbackCounts.compute(
+ fallbackPolicy,
+ (k, v) -> {
+ LongAdder fallbackCount = v;
+ if (fallbackCount == null) {
+ fallbackCount = new LongAdder();
Review Comment:
Use Long is enough?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@celeborn.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CELEBORN-1685] ShuffleFallbackPolicy supports ShuffleFallbackCount metric [celeborn]
Posted by "turboFei (via GitHub)" <gi...@apache.org>.
turboFei commented on code in PR #2891:
URL: https://github.com/apache/celeborn/pull/2891#discussion_r1833420646
##########
client/src/main/scala/org/apache/celeborn/client/LifecycleManager.scala:
##########
@@ -210,7 +211,10 @@ class LifecycleManager(val appUniqueId: String, val conf: CelebornConf) extends
appUniqueId,
conf,
masterClient,
- () => commitManager.commitMetrics() -> shuffleFallbackCount.sumThenReset(),
+ () =>
+ commitManager.commitMetrics() -> (shuffleFallbackCount.sumThenReset(),
+ shuffleFallbackCounts.asScala.map(count =>
+ (count._1, new java.lang.Long(count._2.sumThenReset()))).toMap),
Review Comment:
need to exclude the keyPair that value is `0` to reduce the heart beat message
##########
client/src/main/scala/org/apache/celeborn/client/LifecycleManager.scala:
##########
@@ -210,7 +211,10 @@ class LifecycleManager(val appUniqueId: String, val conf: CelebornConf) extends
appUniqueId,
conf,
masterClient,
- () => commitManager.commitMetrics() -> shuffleFallbackCount.sumThenReset(),
+ () =>
+ commitManager.commitMetrics() -> (shuffleFallbackCount.sumThenReset(),
+ shuffleFallbackCounts.asScala.map(count =>
+ (count._1, new java.lang.Long(count._2.sumThenReset()))).toMap),
Review Comment:
need to exclude the keyPair that value is `0` to reduce the heart beat message size
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@celeborn.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CELEBORN-1685] ShuffleFallbackPolicy supports ShuffleFallbackCount metric [celeborn]
Posted by "turboFei (via GitHub)" <gi...@apache.org>.
turboFei commented on code in PR #2891:
URL: https://github.com/apache/celeborn/pull/2891#discussion_r1835170347
##########
master/src/main/scala/org/apache/celeborn/service/deploy/master/Master.scala:
##########
@@ -1095,22 +1101,35 @@ private[celeborn] class Master(
}
}
+ private def gaugeShuffleFallbackCounts(): Unit = {
+ statusSystem.shuffleFallbackCounts.entrySet().asScala.foreach { shuffleFallbackCount =>
+ masterSource.addGauge(
+ MasterSource.SHUFFLE_FALLBACK_COUNT,
+ Map("fallbackPolicy" -> shuffleFallbackCount.getKey)) { () =>
+ shuffleFallbackCount.getValue
Review Comment:
I think it is better to get the entry by get during runtime, in case the entry is cleaned, not sure.
```
Option(statusSystem.shuffleFallbackCounts.get(shuffleFallbackCount.getKey)).getOrElse(0)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@celeborn.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CELEBORN-1685] ShuffleFallbackPolicy supports ShuffleFallbackCount metric [celeborn]
Posted by "FMX (via GitHub)" <gi...@apache.org>.
FMX commented on code in PR #2891:
URL: https://github.com/apache/celeborn/pull/2891#discussion_r1832602056
##########
common/src/main/proto/TransportMessages.proto:
##########
@@ -443,6 +443,7 @@ message PbHeartbeatFromApplication {
repeated PbWorkerInfo needCheckedWorkerList = 5;
bool shouldResponse = 6;
int64 shuffleFallbackCount = 7;
+ map<string, int64> shuffleFallbackCounts = 8;
Review Comment:
Looks weird to keep two variables of the same purpose. You can calculate the total fallback count from the detailed fallback count.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@celeborn.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CELEBORN-1685] ShuffleFallbackPolicy supports ShuffleFallbackCount metric [celeborn]
Posted by "turboFei (via GitHub)" <gi...@apache.org>.
turboFei commented on code in PR #2891:
URL: https://github.com/apache/celeborn/pull/2891#discussion_r1835170347
##########
master/src/main/scala/org/apache/celeborn/service/deploy/master/Master.scala:
##########
@@ -1095,22 +1101,35 @@ private[celeborn] class Master(
}
}
+ private def gaugeShuffleFallbackCounts(): Unit = {
+ statusSystem.shuffleFallbackCounts.entrySet().asScala.foreach { shuffleFallbackCount =>
+ masterSource.addGauge(
+ MasterSource.SHUFFLE_FALLBACK_COUNT,
+ Map("fallbackPolicy" -> shuffleFallbackCount.getKey)) { () =>
+ shuffleFallbackCount.getValue
Review Comment:
I think it is better to get the entry by key during runtime, in case the entry is cleaned, not sure.
```
Option(statusSystem.shuffleFallbackCounts.get(shuffleFallbackCount.getKey)).getOrElse(0)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@celeborn.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CELEBORN-1685] ShuffleFallbackPolicy supports ShuffleFallbackCount metric [celeborn]
Posted by "RexXiong (via GitHub)" <gi...@apache.org>.
RexXiong closed pull request #2891: [CELEBORN-1685] ShuffleFallbackPolicy supports ShuffleFallbackCount metric
URL: https://github.com/apache/celeborn/pull/2891
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@celeborn.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CELEBORN-1685] ShuffleFallbackPolicy supports ShuffleFallbackCount metric [celeborn]
Posted by "turboFei (via GitHub)" <gi...@apache.org>.
turboFei commented on code in PR #2891:
URL: https://github.com/apache/celeborn/pull/2891#discussion_r1835166929
##########
common/src/main/scala/org/apache/celeborn/common/protocol/message/ControlMessages.scala:
##########
@@ -1208,11 +1211,16 @@ object ControlMessages extends Logging {
case HEARTBEAT_FROM_APPLICATION_VALUE =>
val pbHeartbeatFromApplication = PbHeartbeatFromApplication.parseFrom(message.getPayload)
+ val shuffleFallbackCountMap = new util.HashMap[String, java.lang.Long]()
+ pbHeartbeatFromApplication.getShuffleFallbackCountsMap.asScala.foreach { entry =>
+ shuffleFallbackCountMap.put(entry._1, entry._2)
+ }
Review Comment:
can we use the `pbHeartbeatFromApplication.getShuffleFallbackCountsMap` directly?
or putAll to `shuffleFallbackCountMap`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@celeborn.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CELEBORN-1685] ShuffleFallbackPolicy supports ShuffleFallbackCount metric [celeborn]
Posted by "turboFei (via GitHub)" <gi...@apache.org>.
turboFei commented on code in PR #2891:
URL: https://github.com/apache/celeborn/pull/2891#discussion_r1833420646
##########
client/src/main/scala/org/apache/celeborn/client/LifecycleManager.scala:
##########
@@ -210,7 +211,10 @@ class LifecycleManager(val appUniqueId: String, val conf: CelebornConf) extends
appUniqueId,
conf,
masterClient,
- () => commitManager.commitMetrics() -> shuffleFallbackCount.sumThenReset(),
+ () =>
+ commitManager.commitMetrics() -> (shuffleFallbackCount.sumThenReset(),
+ shuffleFallbackCounts.asScala.map(count =>
+ (count._1, new java.lang.Long(count._2.sumThenReset()))).toMap),
Review Comment:
need to exclude the keyPair that value is `0`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@celeborn.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CELEBORN-1685] ShuffleFallbackPolicy supports ShuffleFallbackCount metric [celeborn]
Posted by "turboFei (via GitHub)" <gi...@apache.org>.
turboFei commented on code in PR #2891:
URL: https://github.com/apache/celeborn/pull/2891#discussion_r1833421379
##########
common/src/main/proto/TransportMessages.proto:
##########
@@ -443,6 +443,7 @@ message PbHeartbeatFromApplication {
repeated PbWorkerInfo needCheckedWorkerList = 5;
bool shouldResponse = 6;
int64 shuffleFallbackCount = 7;
+ map<string, int64> shuffleFallbackCounts = 8;
Review Comment:
+1, remove the original one
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@celeborn.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CELEBORN-1685] ShuffleFallbackPolicy supports ShuffleFallbackCount metric [celeborn]
Posted by "RexXiong (via GitHub)" <gi...@apache.org>.
RexXiong commented on code in PR #2891:
URL: https://github.com/apache/celeborn/pull/2891#discussion_r1834020878
##########
client/src/main/scala/org/apache/celeborn/client/LifecycleManager.scala:
##########
@@ -210,10 +211,18 @@ class LifecycleManager(val appUniqueId: String, val conf: CelebornConf) extends
appUniqueId,
conf,
masterClient,
- () => commitManager.commitMetrics() -> shuffleFallbackCount.sumThenReset(),
+ () => {
+ commitManager.commitMetrics() ->
+ (shuffleCount.sumThenReset(), sumThenResetFallbackCounts())
+ },
workerStatusTracker,
registeredShuffle,
reason => cancelAllActiveStages(reason))
+ private def sumThenResetFallbackCounts(): Map[String, java.lang.Long] = {
+ val fallbackCounts = shuffleFallbackCounts.asScala.filter(_._2 > 0L).toMap
+ shuffleFallbackCounts.clear()
Review Comment:
The clear operation may result in the loss of the shuffleFallbackCount, as it will reset the fallback count that was just added.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@celeborn.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CELEBORN-1685] ShuffleFallbackPolicy supports ShuffleFallbackCount metric [celeborn]
Posted by "turboFei (via GitHub)" <gi...@apache.org>.
turboFei commented on code in PR #2891:
URL: https://github.com/apache/celeborn/pull/2891#discussion_r1835165381
##########
client/src/main/scala/org/apache/celeborn/client/LifecycleManager.scala:
##########
@@ -210,10 +211,18 @@ class LifecycleManager(val appUniqueId: String, val conf: CelebornConf) extends
appUniqueId,
conf,
masterClient,
- () => commitManager.commitMetrics() -> shuffleFallbackCount.sumThenReset(),
+ () => {
+ commitManager.commitMetrics() ->
+ (shuffleCount.sumThenReset(), resetShuffleFallbackCounts())
+ },
workerStatusTracker,
registeredShuffle,
reason => cancelAllActiveStages(reason))
+ private def resetShuffleFallbackCounts(): Map[String, java.lang.Long] = {
+ val fallbackCounts = shuffleFallbackCounts.asScala.filter(_._2 > 0L).toMap
+ shuffleFallbackCounts.replaceAll((_, _) => 0L)
+ fallbackCounts
Review Comment:
```
val fallbackCounts = new util.HashMap[String, java.lang.Long]()
shuffleFallbackCounts.keys().asScala.foreach { key =>
Option(shuffleFallbackCounts.remove(key)).filter(_ > 0).foreach(fallbackCounts.put(key, _))
}
fallbackCounts.asScala.toMap
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@celeborn.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CELEBORN-1685] ShuffleFallbackPolicy supports ShuffleFallbackCount metric [celeborn]
Posted by "SteNicholas (via GitHub)" <gi...@apache.org>.
SteNicholas commented on code in PR #2891:
URL: https://github.com/apache/celeborn/pull/2891#discussion_r1833792435
##########
common/src/main/scala/org/apache/celeborn/common/protocol/message/ControlMessages.scala:
##########
@@ -1208,11 +1211,16 @@ object ControlMessages extends Logging {
case HEARTBEAT_FROM_APPLICATION_VALUE =>
val pbHeartbeatFromApplication = PbHeartbeatFromApplication.parseFrom(message.getPayload)
+ val shuffleFallbackCountMap = new util.HashMap[String, java.lang.Long]()
+ pbHeartbeatFromApplication.getShuffleFallbackCountsMap.asScala.foreach { entry =>
Review Comment:
@turboFei, no. The implementation of `getShuffleFallbackCountsMap ` could not be null.
```
public java.util.Map<java.lang.String, java.lang.Long> getShuffleFallbackCountsMap() {
return internalGetShuffleFallbackCounts().getMap();
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@celeborn.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CELEBORN-1685] ShuffleFallbackPolicy supports ShuffleFallbackCount metric [celeborn]
Posted by "SteNicholas (via GitHub)" <gi...@apache.org>.
SteNicholas commented on code in PR #2891:
URL: https://github.com/apache/celeborn/pull/2891#discussion_r1833860308
##########
master/src/main/scala/org/apache/celeborn/service/deploy/master/Master.scala:
##########
@@ -261,8 +261,20 @@ private[celeborn] class Master(
}).sum()
}
+ masterSource.addGauge(MasterSource.SHUFFLE_TOTAL_COUNT) { () =>
+ statusSystem.shuffleTotalCount.sum()
+ }
+
masterSource.addGauge(MasterSource.SHUFFLE_FALLBACK_COUNT) { () =>
- statusSystem.shuffleTotalFallbackCount.sum()
+ statusSystem.shuffleFallbackCounts.values().asScala.map(_.longValue()).sum
+ }
+
+ statusSystem.shuffleFallbackCounts.entrySet().asScala.foreach { shuffleFallbackCount =>
Review Comment:
@turboFei, thanks for reminder. I have updated the registration after `statusSystem.handleAppHeartbeat`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@celeborn.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org