-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[server][controller] Close VeniceWriters in MetaStoreWriter concurren…
…tly and in bounded time (#710) This PR addresses the issue in the current `MetaStoreWriter::close` implementation, which uses `parallelStream` to close Venice writers. Since no thread pool is specified for running `parallelStream`, it uses threads from `ForkJoin.commonPool`. This can lead to issues where other parts of the system monopolize the FJ thread pool, causing a lack of guaranteed concurrency during the close operation. In other cases, the `MetaStoreWriter` itself may monopolize the FJ thread pool, preventing other system components' access to it. This PR addresses the issue by eliminating the dependency on the FJ common pool during the MetaStore shutdown. It introduces the `VeniceWriter::closeAsync` API to close Venice writers asynchronously. This async operation runs in the Venice writer's dedicated elastic thread pool, which ensures concurrent and predictable behavior during the close process.
- Loading branch information
1 parent
781f3dd
commit 1ff609a
Showing
14 changed files
with
336 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...rnal/venice-common/src/main/java/com/linkedin/venice/utils/VeniceResourceCloseResult.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.linkedin.venice.utils; | ||
|
||
public enum VeniceResourceCloseResult { | ||
SUCCESS(0), ALREADY_CLOSED(1), FAILED(2), UNKNOWN(3); | ||
|
||
private final int statusCode; | ||
|
||
VeniceResourceCloseResult(int statusCode) { | ||
this.statusCode = statusCode; | ||
} | ||
|
||
public int getStatusCode() { | ||
return statusCode; | ||
} | ||
} |
Oops, something went wrong.