@ -36,7 +37,12 @@ public class TaskCorruptedException extends StreamsException {
@@ -36,7 +37,12 @@ public class TaskCorruptedException extends StreamsException {
// registered but need to be initialized (i.e. set its starting, end, limit offsets)
@ -291,6 +293,7 @@ public class StoreChangelogReader implements ChangelogReader {
@@ -291,6 +293,7 @@ public class StoreChangelogReader implements ChangelogReader {
publicvoidenforceRestoreActive(){
if(state!=ChangelogReaderState.ACTIVE_RESTORING){
log.debug("Transiting to restore active tasks: {}",changelogs);
lastRestoreLogTime=0L;
// pause all partitions that are for standby tasks from the restore consumer
@ -427,19 +430,20 @@ public class StoreChangelogReader implements ChangelogReader {
@@ -427,19 +430,20 @@ public class StoreChangelogReader implements ChangelogReader {
// for restoring active and updating standby we may prefer different poll time
// in order to make sure we call the main consumer#poll in time.
// TODO: once we move ChangelogReader to a separate thread this may no longer be a concern
thrownewStreamsException("Restore consumer get unexpected error polling records.",e);
}
@ -448,7 +452,7 @@ public class StoreChangelogReader implements ChangelogReader {
@@ -448,7 +452,7 @@ public class StoreChangelogReader implements ChangelogReader {
// even if some partition do not have any accumulated data, we still trigger
// restoring since some changelog may not need to restore any at all, and the
// restore to end check needs to be executed still.
@ -458,9 +462,48 @@ public class StoreChangelogReader implements ChangelogReader {
@@ -458,9 +462,48 @@ public class StoreChangelogReader implements ChangelogReader {
// we only consider updating the limit offset for standbys if we are not restoring active tasks
if(state==ChangelogReaderState.STANDBY_UPDATING&&
@ -496,8 +539,9 @@ public class StoreChangelogReader implements ChangelogReader {
@@ -496,8 +539,9 @@ public class StoreChangelogReader implements ChangelogReader {
@ -572,8 +616,9 @@ public class StoreChangelogReader implements ChangelogReader {
@@ -572,8 +616,9 @@ public class StoreChangelogReader implements ChangelogReader {
@ -617,8 +662,9 @@ public class StoreChangelogReader implements ChangelogReader {
@@ -617,8 +662,9 @@ public class StoreChangelogReader implements ChangelogReader {
// for active changelogs, we need to find their end offset before transit to restoring
// if the changelog is on source topic, then its end offset should be the minimum of
@ -631,11 +677,13 @@ public class StoreChangelogReader implements ChangelogReader {
@@ -631,11 +677,13 @@ public class StoreChangelogReader implements ChangelogReader {
// NOTE we assume that all requested partitions will be included in the returned map for both end/committed
@ -643,33 +691,36 @@ public class StoreChangelogReader implements ChangelogReader {
@@ -643,33 +691,36 @@ public class StoreChangelogReader implements ChangelogReader {
@ -743,7 +794,7 @@ public class StoreChangelogReader implements ChangelogReader {
@@ -743,7 +794,7 @@ public class StoreChangelogReader implements ChangelogReader {
// separate those who do not have the current offset loaded from checkpoint
@ -223,6 +226,7 @@ public class StoreChangelogReaderTest extends EasyMockSupport {
@@ -223,6 +226,7 @@ public class StoreChangelogReaderTest extends EasyMockSupport {
@ -249,6 +253,7 @@ public class StoreChangelogReaderTest extends EasyMockSupport {
@@ -249,6 +253,7 @@ public class StoreChangelogReaderTest extends EasyMockSupport {
@ -315,6 +320,7 @@ public class StoreChangelogReaderTest extends EasyMockSupport {
@@ -315,6 +320,7 @@ public class StoreChangelogReaderTest extends EasyMockSupport {
@ -411,6 +417,7 @@ public class StoreChangelogReaderTest extends EasyMockSupport {
@@ -411,6 +417,7 @@ public class StoreChangelogReaderTest extends EasyMockSupport {
@ -472,6 +479,7 @@ public class StoreChangelogReaderTest extends EasyMockSupport {
@@ -472,6 +479,7 @@ public class StoreChangelogReaderTest extends EasyMockSupport {
@ -541,6 +549,7 @@ public class StoreChangelogReaderTest extends EasyMockSupport {
@@ -541,6 +549,7 @@ public class StoreChangelogReaderTest extends EasyMockSupport {
@ -849,6 +858,11 @@ public class StoreChangelogReaderTest extends EasyMockSupport {
@@ -849,6 +858,11 @@ public class StoreChangelogReaderTest extends EasyMockSupport {
@ -889,6 +903,7 @@ public class StoreChangelogReaderTest extends EasyMockSupport {
@@ -889,6 +903,7 @@ public class StoreChangelogReaderTest extends EasyMockSupport {