Skip to content

Conversation

@zwangsheng
Copy link
Contributor

@zwangsheng zwangsheng commented Oct 24, 2023

Why are the changes needed?

Fixed an issue where spark submit(BatchJobSubmission) could not be closed when invoking the delete interface to delete a batch in the process of submission with batch v2 feature.

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 locally before make a pull request

  • Run exist unit test.

Was this patch authored or co-authored using generative AI tooling?

No

… enabled v2 and current kyuubi not submitted this batch
@zwangsheng zwangsheng changed the title [KYUUBI #5513][Improvement][BATCH] Redirect delete batch request when… [KYUUBI #5513][Improvement][BATCH] Redirect delete batch request when enabled v2 and current kyuubi not submitted this batch Oct 24, 2023
} else if (batchV2Enabled(metadata.requestConf) && metadata.state == "INITIALIZED" &&
batchService.get.cancelUnscheduledBatch(batchId)) {
new CloseBatchResponse(true, s"Unscheduled batch $batchId is canceled.")
} else if (metadata.kyuubiInstance != fe.connectionUrl) {
Copy link
Member

Choose a reason for hiding this comment

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

should we add condition metadata.kyuubiInstance != null?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, metadata.kyuubiInstance = null may happen when this batch picked within this function. Due to we won't fresh batch state by getting newest metadata.

We can call this delete function again to handle this case

@pan3793 pan3793 changed the title [KYUUBI #5513][Improvement][BATCH] Redirect delete batch request when enabled v2 and current kyuubi not submitted this batch [KYUUBI #5513][BATCH] Always redirect delete batch request to Kyuubi instance that owns batch session Oct 24, 2023
@zwangsheng zwangsheng requested a review from pan3793 October 25, 2023 06:03
zwangsheng and others added 2 commits October 25, 2023 14:44
…atchesResource.scala

Co-authored-by: Cheng Pan <pan3793@gmail.com>
…atchesResource.scala

Co-authored-by: Cheng Pan <pan3793@gmail.com>
@pan3793 pan3793 added this to the v1.8.0 milestone Oct 25, 2023
@pan3793 pan3793 added the kind:bug This is a clearly a bug label Oct 25, 2023
@pan3793 pan3793 closed this in feb9d16 Oct 25, 2023
pan3793 added a commit that referenced this pull request Oct 25, 2023
…instance that owns batch session

### _Why are the changes needed?_

Fixed an issue where spark submit(BatchJobSubmission) could not be closed when invoking the delete interface to delete a batch in the process of submission with batch v2 feature.

### _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

- [x] Run exist unit test.

### _Was this patch authored or co-authored using generative AI tooling?_
No

Closes #5514 from zwangsheng/KYUUBI#5513.

Closes #5513

868c026 [Cheng Pan] Update kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/BatchesResource.scala
1e44acf [Cheng Pan] Update kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/BatchesResource.scala
f0b3a53 [Binjie Yang] Update kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/BatchesResource.scala
a238e45 [Binjie Yang] Update kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/BatchesResource.scala
565b938 [zwangsheng] modify comments
86ef016 [zwangsheng] add comment and catch spec case
4c40863 [zwangsheng] fix comments
73f89f0 [zwangsheng] [KYUUBI #5513][Improvement][BATCH] Redirect delete batch request when enabled v2 and current kyuubi not submitted this batch

Lead-authored-by: zwangsheng <binjieyang@apache.org>
Co-authored-by: Cheng Pan <pan3793@gmail.com>
Co-authored-by: Binjie Yang <binjieyang@apache.org>
Signed-off-by: Cheng Pan <chengpan@apache.org>
(cherry picked from commit feb9d16)
Signed-off-by: Cheng Pan <chengpan@apache.org>
@pan3793
Copy link
Member

pan3793 commented Oct 25, 2023

Merged to master/1.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:bug This is a clearly a bug module:server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants