Skip to content
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

Pipe: Revert "Pipe: stop pipe using restarting strategy to unpin the wal's reference count to avoid WAL stacking (#11971)" to avoid unnecessary pipe drop during subtask exception handling #12031

Merged
merged 1 commit into from
Feb 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -555,29 +555,34 @@ private void startPipe(String pipeName, long creationTime) {
}

protected void stopPipe(String pipeName, long creationTime) {
final PipeMeta pipeMeta = pipeMetaKeeper.getPipeMeta(pipeName);
final PipeMeta existedPipeMeta = pipeMetaKeeper.getPipeMeta(pipeName);

if (!checkBeforeStopPipe(existedPipeMeta, pipeName, creationTime)) {
return;
}

if (!checkBeforeStopPipe(pipeMeta, pipeName, creationTime)) {
// Get pipe tasks
final Map<TConsensusGroupId, PipeTask> pipeTasks =
pipeTaskManager.getPipeTasks(existedPipeMeta.getStaticMeta());
if (pipeTasks == null) {
LOGGER.info(
"Stop Pipe: Pipe {} has already been dropped or has not been created. Skip stopping.",
pipeName);
"Pipe {} (creation time = {}) has already been dropped or has not been created. "
+ "Skip stopping.",
pipeName,
creationTime);
return;
}

// 1. Drop the pipe task
// Trigger stop() method for each pipe task by parallel stream
final long startTime = System.currentTimeMillis();
handleDropPipeInternal(pipeMeta.getStaticMeta().getPipeName());

// 2. Set pipe meta status to STOPPED
pipeMeta.getRuntimeMeta().getStatus().set(PipeStatus.STOPPED);

// 3. create a new pipe with the same pipeMeta
createPipe(pipeMeta);

pipeTasks.values().parallelStream().forEach(PipeTask::stop);
LOGGER.info(
"Stop all pipe tasks on Pipe {} successfully within {} ms",
pipeName,
System.currentTimeMillis() - startTime);

// Set pipe meta status to STOPPED
existedPipeMeta.getRuntimeMeta().getStatus().set(PipeStatus.STOPPED);
}

////////////////////////// Checker //////////////////////////
Expand Down
Loading