SteveYurongSu commented on code in PR #11998:
URL: https://github.com/apache/iotdb/pull/11998#discussion_r1542402774
##########
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/consensus/statemachine/ConfigRegionStateMachine.java:
##########
@@ -197,12 +198,34 @@ protected DataSet read(ConfigPhysicalPlan plan) {
@Override
public boolean takeSnapshot(File snapshotDir) {
- return executor.takeSnapshot(snapshotDir);
+ if (executor.takeSnapshot(snapshotDir)) {
+ try {
+ PipeConfigNodeAgent.runtime()
+ .listener()
+ .tryListenToSnapshots(ConfignodeSnapshotParser.getSnapshots());
+ return true;
+ } catch (IOException e) {
+ LOGGER.error(
+ "Config Region Listening Queue Listen to snapshot failed, the
historical data may not be transferred.",
+ e);
+ }
+ }
+ return false;
}
@Override
public void loadSnapshot(File latestSnapshotRootDir) {
- executor.loadSnapshot(latestSnapshotRootDir);
+ try {
+ executor.loadSnapshot(latestSnapshotRootDir);
+ // We recompute the snapshot for pipe listener when loading snapshot
+ // to recover the newest snapshot in cache
+ PipeConfigNodeAgent.runtime()
+ .listener()
+ .tryListenToSnapshots(ConfignodeSnapshotParser.getSnapshots());
+ } catch (IOException e) {
+ LOGGER.error(
+ "Config Region Listening Queue Listen to snapshot failed when
startup, snapshot will be tried again when starting schema transferring pipes");
Review Comment:
```suggestion
LOGGER.error(
"Config Region Listening Queue Listen to snapshot failed when
startup, snapshot will be tried again when starting schema transferring pipes",
e);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]