@@ -714,6 +714,8 @@ The next upload iteration will be delayed.`);
714714
715715 if ( isStreamingSyncCheckpoint ( line ) ) {
716716 targetCheckpoint = line . checkpoint ;
717+ // New checkpoint - existing validated checkpoint is no longer valid
718+ pendingValidatedCheckpoint = null ;
717719 const bucketsToDelete = new Set < string > ( bucketMap . keys ( ) ) ;
718720 const newBuckets = new Map < string , BucketDescription > ( ) ;
719721 for ( const checksum of line . checkpoint . buckets ) {
@@ -735,7 +737,13 @@ The next upload iteration will be delayed.`);
735737 if ( result . endIteration ) {
736738 return ;
737739 } else if ( ! result . applied ) {
740+ // "Could not apply checkpoint due to local data". We need to retry after
741+ // finishing uploads.
738742 pendingValidatedCheckpoint = targetCheckpoint ;
743+ } else {
744+ // Nothing to retry later. This would likely already be null from the last
745+ // checksum or checksum_diff operation, but we make sure.
746+ pendingValidatedCheckpoint = null ;
739747 }
740748 } else if ( isStreamingSyncCheckpointPartiallyComplete ( line ) ) {
741749 const priority = line . partial_checkpoint_complete . priority ;
@@ -771,6 +779,8 @@ The next upload iteration will be delayed.`);
771779 if ( targetCheckpoint == null ) {
772780 throw new Error ( 'Checkpoint diff without previous checkpoint' ) ;
773781 }
782+ // New checkpoint - existing validated checkpoint is no longer valid
783+ pendingValidatedCheckpoint = null ;
774784 const diff = line . checkpoint_diff ;
775785 const newBuckets = new Map < string , BucketChecksum > ( ) ;
776786 for ( const checksum of targetCheckpoint . buckets ) {
0 commit comments