Skip to content
Merged
Show file tree
Hide file tree
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 @@ -116,6 +116,8 @@ public class CommonConfig {
/** Status of current system. */
private volatile NodeStatus status = NodeStatus.Running;

private volatile boolean isStopping = false;

private volatile String statusReason = null;

/** Disk Monitor */
Expand Down Expand Up @@ -360,4 +362,12 @@ public TEndPoint getTargetMLNodeEndPoint() {
public void setTargetMLNodeEndPoint(TEndPoint targetMLNodeEndPoint) {
this.targetMLNodeEndPoint = targetMLNodeEndPoint;
}

public boolean isStopping() {
return isStopping;
}

public void setStopping(boolean stopping) {
isStopping = stopping;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ public void stop() {

@Override
public boolean isReadOnly() {
return CommonDescriptor.getInstance().getConfig().isReadOnly();
return CommonDescriptor.getInstance().getConfig().isReadOnly()
&& !CommonDescriptor.getInstance().getConfig().isStopping();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public void run() {
}

// reject write operations to make sure all tsfiles will be sealed
CommonDescriptor.getInstance().getConfig().setStopping(true);
CommonDescriptor.getInstance().getConfig().setNodeStatus(NodeStatus.ReadOnly);
// wait all wal are flushed
WALManager.getInstance().waitAllWALFlushed();
Expand Down