Skip to content

Support shutting down coordinator using /info/state endpoint#15992

Merged
tdcmeehan merged 1 commit intoprestodb:masterfrom
abhiseksaikia:asaikia_coordinator_shutdown
Apr 27, 2021
Merged

Support shutting down coordinator using /info/state endpoint#15992
tdcmeehan merged 1 commit intoprestodb:masterfrom
abhiseksaikia:asaikia_coordinator_shutdown

Conversation

@abhiseksaikia
Copy link
Contributor

@abhiseksaikia abhiseksaikia commented Apr 23, 2021

Support shutting down coordinator using PUT /info/state

Currently we cannot shut down coordinator through /info/state endpoint. With the disagg coordinator setup, we should able to do this so that we can drain individual coordinators gracefully.

Test plan -

  1. Verified by running unit test
  2. Verified by running HiveQueryRunner in local -
    Use PUT /v1/info endpoint with payload "SHUTTING_DOWN"
    Before the coordinator is shutdown, GET /v1/info/state returns "SHUTTING_DOWN" as the response.
    Once the coordinator is shutdown (after grace period), server refuses connection to port used by coordinator

== RELEASE NOTES ==

General Changes

  • Add support for shutting down coordinator via the /v1/info/state endpoint.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Apr 23, 2021

CLA Signed

The committers are authorized under a signed CLA.

  • ✅ abhiseksaikia (459ea131256b61616f151a111dddd0662c4fcae3)

@aweisberg
Copy link
Contributor

I think you submitted the EasyCLA request incorrectly? You need to select Uber as your company.

@abhiseksaikia
Copy link
Contributor Author

abhiseksaikia commented Apr 23, 2021

I think you submitted the EasyCLA request incorrectly? You need to select Uber as your company.

Sorry for the confusion, I had the primary email as my gmail account with Uber signature on linuxfoundation :) I made the changes to use FB email account as my primary email and went through the acknowledgement.

@abhiseksaikia abhiseksaikia marked this pull request as draft April 23, 2021 22:20
@abhiseksaikia abhiseksaikia force-pushed the asaikia_coordinator_shutdown branch 2 times, most recently from f42b1c1 to 6b3d8e3 Compare April 26, 2021 17:21
@abhiseksaikia abhiseksaikia marked this pull request as ready for review April 26, 2021 17:22
@abhiseksaikia abhiseksaikia force-pushed the asaikia_coordinator_shutdown branch from 6b3d8e3 to 350d819 Compare April 26, 2021 17:45
@abhiseksaikia abhiseksaikia changed the title Support shutting down coordinator Support shutting down coordinator using /info/state endpoint Apr 26, 2021
@abhiseksaikia abhiseksaikia force-pushed the asaikia_coordinator_shutdown branch from 350d819 to 459ea13 Compare April 26, 2021 18:20
Copy link
Contributor

Choose a reason for hiding this comment

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

use requireNonNull to fail fast.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, I have made the changes

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this can be done in just the worker path.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I included this for coordinator to cover the cases where "node-scheduler.include-coordinator" is used as true. Please correct me if I am wrong here.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it make sense to skip this for coordinator given query monitoring will consider tasks as well. So it becomes redundant for coordinator. So let's skip this for coordinator.

Copy link
Contributor

Choose a reason for hiding this comment

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

What does this mean?

Copy link
Contributor Author

@abhiseksaikia abhiseksaikia Apr 26, 2021

Choose a reason for hiding this comment

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

This is not required, I have removed this.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a max time limit to this test

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, added timeout for the test.

@abhiseksaikia abhiseksaikia force-pushed the asaikia_coordinator_shutdown branch 2 times, most recently from 6540b86 to 499993c Compare April 26, 2021 22:05
@tdcmeehan
Copy link
Contributor

Test failure looks relevant. Otherwise LGTM.

Currently we cannot shut down coordinator through /info/state endpoint.With the disagg coordinator setup, we should able to do this so that we can drain individual coordinators gracefully.
@abhiseksaikia abhiseksaikia force-pushed the asaikia_coordinator_shutdown branch from 499993c to 6989f0f Compare April 27, 2021 16:22
@tdcmeehan tdcmeehan merged commit 6b36706 into prestodb:master Apr 27, 2021
@bhhari bhhari mentioned this pull request May 11, 2021
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants