Skip to content

Commit 7f01d3a

Browse files
committed
[PLAT-15812]Multiple schedule edits increase incremental backup time unbounded
Summary: We were incrementing next incremental backup schedule time with each edit schedule in an unbounded fashion. So, incremental backup schedule time kept on increasing even when it should not have increased. Fixed by checking first that the incremental backup next schedule task time needs an update or not. Test Plan: Manual verification Reviewers: vbansal Reviewed By: vbansal Subscribers: yugaware Differential Revision: https://phorge.dev.yugabyte.com/D39305
1 parent f60aa9f commit 7f01d3a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

managed/src/main/java/com/yugabyte/yw/common/ScheduleUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@ public static Date nextExpectedIncrementTaskTime(Schedule schedule, Date current
104104
}
105105

106106
// check if calculated increment backup time is after current time
107-
do {
107+
while (Util.isTimeExpired(nextIncrementScheduleTaskTime, currentTime)) {
108108
nextIncrementScheduleTaskTime =
109109
new Date(nextIncrementScheduleTaskTime.getTime() + incrementFrequency);
110-
} while (currentTime.after(nextIncrementScheduleTaskTime));
110+
}
111111

112112
return nextIncrementScheduleTaskTime;
113113
}

0 commit comments

Comments
 (0)