-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[server] Dropping unassigned partitions #1196
base: main
Are you sure you want to change the base?
Conversation
...ts/da-vinci-client/src/main/java/com/linkedin/davinci/kafka/consumer/StoreIngestionTask.java
Outdated
Show resolved
Hide resolved
services/venice-server/src/main/java/com/linkedin/venice/server/VeniceServer.java
Outdated
Show resolved
Hide resolved
services/venice-server/src/main/java/com/linkedin/venice/server/VeniceServer.java
Outdated
Show resolved
Hide resolved
internal/venice-common/src/main/java/com/linkedin/venice/helix/SafeHelixDataAccessor.java
Outdated
Show resolved
Hide resolved
2e40626
to
01ca67f
Compare
It looks like spotBugs is failing. If you run this locally, you'll be able to read the report to see what's wrong. Make sure to build before running this. |
3e496b1
to
56e7711
Compare
334c1f6
to
04c4e9e
Compare
services/venice-server/src/main/java/com/linkedin/venice/server/VeniceServer.java
Outdated
Show resolved
Hide resolved
…ckWhetherStoragePartitionShouldBeKeptOrNot
clients/da-vinci-client/src/main/java/com/linkedin/davinci/storage/StorageService.java
Outdated
Show resolved
Hide resolved
services/venice-server/src/main/java/com/linkedin/venice/server/VeniceServer.java
Outdated
Show resolved
Hide resolved
142082c
to
4ba8f75
Compare
clients/da-vinci-client/src/main/java/com/linkedin/davinci/storage/StorageService.java
Outdated
Show resolved
Hide resolved
5e43f6f
to
4ba8f75
Compare
Unassigned partitions for store are dropped upon VeniceServer shutdown Remove storage partitions not assigned to host This involves updates in: 1. Updating a function in StorageService to consult ideal state 2. Hostname comparison for each partition 3. Resolution of empty assignment in ideal state 4. Unit test
fa722f1
to
eb71013
Compare
8ceb7cc
to
3364f13
Compare
…d function, unit test, integration test
3364f13
to
0730b55
Compare
The check over which storage partitions to persist is moved to the shutdown phase of VeniceServer which was discussed. Shutdown phase contains call to |
clients/da-vinci-client/src/main/java/com/linkedin/davinci/storage/StorageService.java
Outdated
Show resolved
Hide resolved
services/venice-server/src/main/java/com/linkedin/venice/server/VeniceServer.java
Outdated
Show resolved
Hide resolved
...venice-test-common/src/integrationTest/java/com/linkedin/venice/server/VeniceServerTest.java
Outdated
Show resolved
Hide resolved
[server] Remove storage partitions not assigned to host. Drop unassigned partitions. Update to server to verify partitions to persist. This involves: 1. Updating a function in StorageService to consult ideal state 2. Hostname comparison for each partition 3. Correct call in VeniceServer 4. Unit test 5. Integration test
...venice-test-common/src/integrationTest/java/com/linkedin/venice/server/VeniceServerTest.java
Show resolved
Hide resolved
...venice-test-common/src/integrationTest/java/com/linkedin/venice/server/VeniceServerTest.java
Show resolved
Hide resolved
...venice-test-common/src/integrationTest/java/com/linkedin/venice/server/VeniceServerTest.java
Outdated
Show resolved
Hide resolved
@@ -209,6 +209,9 @@ public void testStartServerAndShutdownWithPartitionAssignmentVerification() { | |||
repository = server.getVeniceServer().getStorageService().getStorageEngineRepository(); | |||
Assert.assertEquals(repository.getAllLocalStorageEngines().size(), 1); | |||
Assert.assertEquals(storageService.getStorageEngine(storeName).getPartitionIds().size(), 0); | |||
server.getVeniceServer().getStorageService().removeStorageEngine(storeName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic should be done in checkWhetherStoragePartitionsShouldBeKeptOrNot
.
If we've deleted all partitions for a storageEngine
, we should call removeStorageEngine
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since removeStorageEngine
, is now called in checkWhetherStoragePartitionsShouldBeKeptOrNot
, you can remove line 212. Once that's in I'll kick it off to Zac.
… storage engine if all partitions have been dropped
if (idealState != null) { | ||
Map<String, Map<String, String>> mapFields = idealState.getRecord().getMapFields(); | ||
for (Integer partitionId: storageEnginePartitionIds) { | ||
String partitionDbName = storeName + "_" + partitionId; | ||
if (!mapFields.containsKey(partitionDbName) | ||
|| !mapFields.get(partitionDbName).containsKey(instanceHostName)) { | ||
storageEngine.dropPartition(partitionId); | ||
} | ||
} | ||
if (storageEngine.getPartitionIds().isEmpty()) { | ||
removeStorageEngine(storeName); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idealState
can be null if the store doesn't exist anymore. I'll leave it up to @ZacAttack whether or not we should remove the storageEngine
in the else conditional.
Summary, imperative, start upper case, don't end with a period
The goal is to remove unassigned partitions that are on disk state
This involves storage service and engine, which upon starting (constructed), will go through folders on disk and verify status of folders
Helix's ideal state is used for consulting partitions and their assignment
The change proposed includes defining a function in VeniceServer that goes through partitions in idealState and compares to partitions in storageEngine
StorageEngine object initialization is also being updated to run the new function that performs this verification.
Resolves #650
How was this PR tested?
Will write corresponding test.
EDIT: A unit test has been written.
Does this PR introduce any user-facing changes?