-
Notifications
You must be signed in to change notification settings - Fork 170
[ISSUE-380] Refactor the flush process to fix fallback fail #383
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
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
30f6b9b
[BUG] Overlook fallback when data-flush event enters into pending queue
zuston df1281c
fix test bug
zuston 1e63047
Add test cases
zuston 1ddfe9c
Add more tests
zuston 8be9265
fix
zuston 42f883f
remove
zuston 31cbb9b
fix
zuston 09c143e
reuse the cache
zuston ead6348
Use the callback to cleanup data-flush-event
zuston 6e7c46f
optimize while exit condition
zuston 896955a
fix size
zuston 25ba191
Invalidate client cache to avoid being closed
zuston 2aa338a
add the metric of total_failed_written_event_num and add comments
zuston e0d6740
fix bug
zuston 58bfe2e
fix comments
zuston 9fa503e
fix
zuston 992dcb3
Make event callback function as runnable
zuston 48082a4
fix
zuston File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
56 changes: 56 additions & 0 deletions
56
...ation-test/common/src/test/java/org/apache/uniffle/test/MultiStorageHdfsFallbackTest.java
This file contains hidden or 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,56 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package org.apache.uniffle.test; | ||
|
|
||
| import java.util.Arrays; | ||
|
|
||
| import org.junit.jupiter.api.BeforeAll; | ||
|
|
||
| import org.apache.uniffle.coordinator.CoordinatorConf; | ||
| import org.apache.uniffle.server.ShuffleServerConf; | ||
| import org.apache.uniffle.storage.util.StorageType; | ||
|
|
||
| import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
|
||
| public class MultiStorageHdfsFallbackTest extends MultiStorageFaultToleranceBase { | ||
|
|
||
| @BeforeAll | ||
| public static void setupServers() throws Exception { | ||
| final CoordinatorConf coordinatorConf = getCoordinatorConf(); | ||
| ShuffleServerConf shuffleServerConf = getShuffleServerConf(); | ||
| String basePath = generateBasePath(); | ||
| shuffleServerConf.setDouble(ShuffleServerConf.CLEANUP_THRESHOLD, 0.0); | ||
| shuffleServerConf.setDouble(ShuffleServerConf.HIGH_WATER_MARK_OF_WRITE, 100.0); | ||
| shuffleServerConf.setLong(ShuffleServerConf.DISK_CAPACITY, 1024L * 1024L * 100); | ||
| shuffleServerConf.setLong(ShuffleServerConf.PENDING_EVENT_TIMEOUT_SEC, 30L); | ||
| shuffleServerConf.setLong(ShuffleServerConf.SHUFFLE_EXPIRED_TIMEOUT_MS, 5000L); | ||
| shuffleServerConf.setLong(ShuffleServerConf.SERVER_APP_EXPIRED_WITHOUT_HEARTBEAT, 60L * 1000L * 60L); | ||
| shuffleServerConf.setLong(ShuffleServerConf.SERVER_COMMIT_TIMEOUT, 20L * 1000L); | ||
| shuffleServerConf.setString(ShuffleServerConf.RSS_STORAGE_TYPE, StorageType.LOCALFILE_HDFS.name()); | ||
| shuffleServerConf.set(ShuffleServerConf.RSS_STORAGE_BASE_PATH, Arrays.asList(basePath)); | ||
| shuffleServerConf.setLong(ShuffleServerConf.FLUSH_COLD_STORAGE_THRESHOLD_SIZE, 1L * 1024L * 1024L); | ||
| createAndStartServers(shuffleServerConf, coordinatorConf); | ||
| } | ||
|
|
||
| @Override | ||
| public void makeChaos() { | ||
| assertEquals(1, cluster.getDataNodes().size()); | ||
| cluster.stopDataNode(0); | ||
| assertEquals(0, cluster.getDataNodes().size()); | ||
| } | ||
| } |
66 changes: 66 additions & 0 deletions
66
...-test/common/src/test/java/org/apache/uniffle/test/MultiStorageLocalfileFallbackTest.java
This file contains hidden or 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,66 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package org.apache.uniffle.test; | ||
|
|
||
| import java.util.Arrays; | ||
|
|
||
| import org.junit.jupiter.api.BeforeAll; | ||
|
|
||
| import org.apache.uniffle.coordinator.CoordinatorConf; | ||
| import org.apache.uniffle.server.ShuffleServerConf; | ||
| import org.apache.uniffle.server.storage.LocalStorageManager; | ||
| import org.apache.uniffle.server.storage.LocalStorageManagerFallbackStrategy; | ||
| import org.apache.uniffle.server.storage.MultiStorageManager; | ||
| import org.apache.uniffle.storage.common.LocalStorage; | ||
| import org.apache.uniffle.storage.common.Storage; | ||
| import org.apache.uniffle.storage.util.StorageType; | ||
|
|
||
| public class MultiStorageLocalfileFallbackTest extends MultiStorageFaultToleranceBase { | ||
|
|
||
| @BeforeAll | ||
| public static void setupServers() throws Exception { | ||
| final CoordinatorConf coordinatorConf = getCoordinatorConf(); | ||
| ShuffleServerConf shuffleServerConf = getShuffleServerConf(); | ||
| String basePath = generateBasePath(); | ||
| shuffleServerConf.setDouble(ShuffleServerConf.CLEANUP_THRESHOLD, 0.0); | ||
| shuffleServerConf.setDouble(ShuffleServerConf.HIGH_WATER_MARK_OF_WRITE, 100.0); | ||
| shuffleServerConf.setLong(ShuffleServerConf.DISK_CAPACITY, 1024L * 1024L * 100); | ||
| shuffleServerConf.setLong(ShuffleServerConf.PENDING_EVENT_TIMEOUT_SEC, 30L); | ||
| shuffleServerConf.setLong(ShuffleServerConf.SHUFFLE_EXPIRED_TIMEOUT_MS, 5000L); | ||
| shuffleServerConf.setLong(ShuffleServerConf.SERVER_APP_EXPIRED_WITHOUT_HEARTBEAT, 60L * 1000L * 60L); | ||
| shuffleServerConf.setLong(ShuffleServerConf.SERVER_COMMIT_TIMEOUT, 20L * 1000L); | ||
| shuffleServerConf.setString(ShuffleServerConf.RSS_STORAGE_TYPE, StorageType.LOCALFILE_HDFS.name()); | ||
| shuffleServerConf.set(ShuffleServerConf.RSS_STORAGE_BASE_PATH, Arrays.asList(basePath)); | ||
| shuffleServerConf.setLong(ShuffleServerConf.FLUSH_COLD_STORAGE_THRESHOLD_SIZE, 1000L * 1024L * 1024L); | ||
| shuffleServerConf.setString( | ||
| ShuffleServerConf.MULTISTORAGE_FALLBACK_STRATEGY_CLASS, | ||
| LocalStorageManagerFallbackStrategy.class.getCanonicalName() | ||
| ); | ||
| createAndStartServers(shuffleServerConf, coordinatorConf); | ||
| } | ||
|
|
||
| @Override | ||
| public void makeChaos() { | ||
| LocalStorageManager warmStorageManager = | ||
| (LocalStorageManager) ((MultiStorageManager)shuffleServers.get(0).getStorageManager()).getWarmStorageManager(); | ||
| for (Storage storage : warmStorageManager.getStorages()) { | ||
| LocalStorage localStorage = (LocalStorage) storage; | ||
| localStorage.markSpaceFull(); | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.