You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by "pan3793 (via GitHub)" <gi...@apache.org> on 2023/09/04 04:34:17 UTC
[GitHub] [kyuubi] pan3793 opened a new pull request, #5243: Distinguish batch impl v2 metadata from recovery
pan3793 opened a new pull request, #5243:
URL: https://github.com/apache/kyuubi/pull/5243
<!--
Thanks for sending a pull request!
Here are some tips for you:
1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/CONTRIBUTING.html
2. If the PR is related to an issue in https://github.com/apache/kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->
### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
1. If you add a feature, you can talk about the use case of it.
2. If you fix a bug, you can clarify why it is a bug.
-->
### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible
- [ ] Add screenshots for manual tests if appropriate
- [ ] [Run test](https://kyuubi.readthedocs.io/en/master/contributing/code/testing.html#running-tests) locally before make a pull request
### _Was this patch authored or co-authored using generative AI tooling?_
<!--
If a generative AI tooling has been used in the process of authoring this patch, please include
phrase 'Generated-by: ' followed by the name of the tool and its version.
If no, write 'No'.
Please refer to the [ASF Generative Tooling Guidance](https://www.apache.org/legal/generative-tooling.html) for details.
-->
--
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: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
[GitHub] [kyuubi] turboFei commented on pull request #5243: [KYUUBI #5243] Distinguish metadata between batch impl v2 and recovery
Posted by "turboFei (via GitHub)" <gi...@apache.org>.
turboFei commented on PR #5243:
URL: https://github.com/apache/kyuubi/pull/5243#issuecomment-1706958132
LGTM
--
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: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
[GitHub] [kyuubi] codecov-commenter commented on pull request #5243: Distinguish metadata between batch impl v2 and recovery
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #5243:
URL: https://github.com/apache/kyuubi/pull/5243#issuecomment-1704654869
## [Codecov](https://app.codecov.io/gh/apache/kyuubi/pull/5243?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
> Merging [#5243](https://app.codecov.io/gh/apache/kyuubi/pull/5243?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (64fb680) into [master](https://app.codecov.io/gh/apache/kyuubi/commit/8f8db09cee92bf1602cd2f5f2a84669b58ed330e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (8f8db09) will **not change** coverage.
> The diff coverage is `0.00%`.
```diff
@@ Coverage Diff @@
## master #5243 +/- ##
======================================
Coverage 0.00% 0.00%
======================================
Files 590 590
Lines 33344 33354 +10
Branches 4403 4406 +3
======================================
- Misses 33344 33354 +10
```
| [Files Changed](https://app.codecov.io/gh/apache/kyuubi/pull/5243?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [...g/apache/kyuubi/operation/BatchJobSubmission.scala](https://app.codecov.io/gh/apache/kyuubi/pull/5243?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9vcGVyYXRpb24vQmF0Y2hKb2JTdWJtaXNzaW9uLnNjYWxh) | `0.00% <0.00%> (ø)` | |
| [...ache/kyuubi/operation/KyuubiOperationManager.scala](https://app.codecov.io/gh/apache/kyuubi/pull/5243?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9vcGVyYXRpb24vS3l1dWJpT3BlcmF0aW9uTWFuYWdlci5zY2FsYQ==) | `0.00% <0.00%> (ø)` | |
| [.../org/apache/kyuubi/server/KyuubiBatchService.scala](https://app.codecov.io/gh/apache/kyuubi/pull/5243?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9zZXJ2ZXIvS3l1dWJpQmF0Y2hTZXJ2aWNlLnNjYWxh) | `0.00% <0.00%> (ø)` | |
| [...org/apache/kyuubi/session/KyuubiBatchSession.scala](https://app.codecov.io/gh/apache/kyuubi/pull/5243?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9zZXNzaW9uL0t5dXViaUJhdGNoU2Vzc2lvbi5zY2FsYQ==) | `0.00% <0.00%> (ø)` | |
| [...g/apache/kyuubi/session/KyuubiSessionManager.scala](https://app.codecov.io/gh/apache/kyuubi/pull/5243?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9zZXNzaW9uL0t5dXViaVNlc3Npb25NYW5hZ2VyLnNjYWxh) | `0.00% <0.00%> (ø)` | |
:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
--
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: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
[GitHub] [kyuubi] pan3793 commented on a diff in pull request #5243: [KYUUBI #5243] Distinguish metadata between batch impl v2 and recovery
Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #5243:
URL: https://github.com/apache/kyuubi/pull/5243#discussion_r1315379821
##########
kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiBatchSession.scala:
##########
@@ -43,7 +43,8 @@ class KyuubiBatchSession(
className: String,
batchConf: Map[String, String],
Review Comment:
merged
--
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: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
[GitHub] [kyuubi] pan3793 commented on a diff in pull request #5243: Distinguish batch impl v2 metadata from recovery
Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #5243:
URL: https://github.com/apache/kyuubi/pull/5243#discussion_r1314427488
##########
kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiBatchSession.scala:
##########
@@ -142,32 +145,47 @@ class KyuubiBatchSession(
override def open(): Unit = handleSessionException {
traceMetricsOnOpen()
- if (recoveryMetadata.isEmpty) {
+ lazy val kubernetesInfo: Map[String, String] = {
val appMgrInfo = batchJobSubmissionOp.builder.appMgrInfo()
- val kubernetesInfo = appMgrInfo.kubernetesInfo.context.map { context =>
+ appMgrInfo.kubernetesInfo.context.map { context =>
Map(KyuubiConf.KUBERNETES_CONTEXT.key -> context)
}.getOrElse(Map.empty) ++ appMgrInfo.kubernetesInfo.namespace.map { namespace =>
Map(KyuubiConf.KUBERNETES_NAMESPACE.key -> namespace)
}.getOrElse(Map.empty)
- val metaData = Metadata(
- identifier = handle.identifier.toString,
- sessionType = sessionType,
- realUser = realUser,
- username = user,
- ipAddress = ipAddress,
- kyuubiInstance = connectionUrl,
- state = OperationState.PENDING.toString,
- resource = resource,
- className = className,
- requestName = name.orNull,
- requestConf = optimizedConf ++ kubernetesInfo, // save the kubernetes info into request conf
- requestArgs = batchArgs,
- createTime = createTime,
- engineType = batchType,
- clusterManager = batchJobSubmissionOp.builder.clusterManager())
-
- // there is a chance that operation failed w/ duplicated key error
- sessionManager.insertMetadata(metaData)
+ }
+
+ (metadata, fromRecovery) match {
+ case (Some(initialMetadata), false) =>
+ // new batch job created using batch impl v2
+ val metadataToUpdate = Metadata(
+ identifier = initialMetadata.identifier,
+ kyuubiInstance = connectionUrl,
+ requestName = name.orNull,
+ requestConf = optimizedConf ++ kubernetesInfo, // save the kubernetes info
+ clusterManager = batchJobSubmissionOp.builder.clusterManager())
+ sessionManager.updateMetadata(metadataToUpdate)
Review Comment:
this is the key change: update metadata created by batch impl v2 before opening batch session
--
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: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
[GitHub] [kyuubi] pan3793 commented on a diff in pull request #5243: [KYUUBI #5243] Distinguish metadata between batch impl v2 and recovery
Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #5243:
URL: https://github.com/apache/kyuubi/pull/5243#discussion_r1314980201
##########
kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiBatchSession.scala:
##########
@@ -43,7 +43,8 @@ class KyuubiBatchSession(
className: String,
batchConf: Map[String, String],
Review Comment:
@turboFei Seems there is no diff between `conf` and `batchConf`, can we merge these two vars into 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: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
[GitHub] [kyuubi] pan3793 commented on a diff in pull request #5243: [KYUUBI #5243] Distinguish metadata between batch impl v2 and recovery
Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #5243:
URL: https://github.com/apache/kyuubi/pull/5243#discussion_r1315186400
##########
kyuubi-server/src/main/scala/org/apache/kyuubi/operation/BatchJobSubmission.scala:
##########
@@ -58,11 +58,12 @@ class BatchJobSubmission(
className: String,
batchConf: Map[String, String],
batchArgs: Seq[String],
- recoveryMetadata: Option[Metadata],
- override val shouldRunAsync: Boolean)
+ metadata: Option[Metadata])
extends KyuubiApplicationOperation(session) {
import BatchJobSubmission._
+ override def shouldRunAsync: Boolean = true
Review Comment:
I wrongly thought it may be `false` on batch impl v2, in fact, it's always `true`.
--
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: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
[GitHub] [kyuubi] pan3793 commented on pull request #5243: [KYUUBI #5243] Distinguish metadata between batch impl v2 and recovery
Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on PR #5243:
URL: https://github.com/apache/kyuubi/pull/5243#issuecomment-1706685010
@turboFei would you please take a look?
--
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: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
[GitHub] [kyuubi] pan3793 commented on a diff in pull request #5243: [KYUUBI #5243] Distinguish metadata between batch impl v2 and recovery
Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #5243:
URL: https://github.com/apache/kyuubi/pull/5243#discussion_r1314971923
##########
kyuubi-server/src/main/scala/org/apache/kyuubi/operation/BatchJobSubmission.scala:
##########
@@ -295,19 +298,19 @@ class BatchJobSubmission(
}
if (_applicationInfo.isEmpty) {
info(s"The $batchType batch[$batchId] job: $appId not found, assume that it has finished.")
- } else if (applicationFailed(_applicationInfo)) {
+ return
+ }
+ if (applicationFailed(_applicationInfo)) {
+ throw new KyuubiException(s"$batchType batch[$batchId] job failed: ${_applicationInfo}")
+ }
+ updateBatchMetadata()
+ // TODO: add limit for max batch job submission lifetime
+ while (_applicationInfo.isDefined && !applicationTerminated(_applicationInfo)) {
+ Thread.sleep(applicationCheckInterval)
+ updateApplicationInfoMetadataIfNeeded()
+ }
+ if (applicationFailed(_applicationInfo)) {
throw new KyuubiException(s"$batchType batch[$batchId] job failed: ${_applicationInfo}")
- } else {
Review Comment:
pure refactor, no logic change here
--
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: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
[GitHub] [kyuubi] pan3793 closed pull request #5243: [KYUUBI #5243] Distinguish metadata between batch impl v2 and recovery
Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 closed pull request #5243: [KYUUBI #5243] Distinguish metadata between batch impl v2 and recovery
URL: https://github.com/apache/kyuubi/pull/5243
--
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: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
[GitHub] [kyuubi] pan3793 commented on pull request #5243: [KYUUBI #5243] Distinguish metadata between batch impl v2 and recovery
Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on PR #5243:
URL: https://github.com/apache/kyuubi/pull/5243#issuecomment-1707153434
Thanks, merged to master/1.8
--
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: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
[GitHub] [kyuubi] pan3793 commented on a diff in pull request #5243: [KYUUBI #5243] Distinguish metadata between batch impl v2 and recovery
Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #5243:
URL: https://github.com/apache/kyuubi/pull/5243#discussion_r1315020898
##########
kyuubi-server/src/main/scala/org/apache/kyuubi/server/KyuubiBatchService.scala:
##########
@@ -83,14 +82,9 @@ class KyuubiBatchService(
metadata.className,
metadata.requestConf,
metadata.requestArgs,
- Some(metadata), // TODO some logic need to fix since it's not from recovery
+ Some(metadata),
+ false,
shouldRunAsync = true)
- val metadataForUpdate = Metadata(
- identifier = batchId,
- kyuubiInstance = kyuubiInstance,
- requestConf = batchSession.optimizedConf,
- clusterManager = batchSession.batchJobSubmissionOp.builder.clusterManager())
- metadataManager.updateMetadata(metadataForUpdate, asyncRetryOnError = false)
Review Comment:
the logic moved to `KyuubiBatchSession#open`
--
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: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org