SzyWilliam commented on code in PR #7303:
URL: https://github.com/apache/iotdb/pull/7303#discussion_r970534767
##########
consensus/src/main/java/org/apache/iotdb/consensus/IStateMachine.java:
##########
@@ -92,6 +92,38 @@ default List<Path> getSnapshotFiles(File
latestSnapshotRootDir) {
return Utils.listAllRegularFilesRecursively(latestSnapshotRootDir);
}
+ /**
+ * To guarantee the statemachine replication property, when {@link
#write(IConsensusRequest)}
+ * failed in this statemachine, Upper consensus implementation like
RatisConsensus may choose to
+ * retry the operation until it exceeds.
+ */
+ interface RetryPolicy {
+
+ /** Given the last write result, should we retry? */
+ default boolean shouldRetry(TSStatus writeResult) {
+ return false;
+ }
+
+ /**
+ * Use the latest write result to update final write result
+ *
+ * @param retryResult the latest write result
+ * @return the aggregated result upon current retry
+ */
+ default TSStatus updateResult(TSStatus retryResult) {
+ return retryResult;
+ }
+
+ /**
+ * sleep time before the next retry
+ *
+ * @return time in millis
+ */
+ default long getSleepTime() {
+ return 0;
Review Comment:
done
--
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]