Skip to content

Commit 60b2632

Browse files
Excluded few e2e tests when running journal v2 default test configuration. See the changes for more details.
1 parent c2541b4 commit 60b2632

File tree

3 files changed

+31
-3
lines changed

3 files changed

+31
-3
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,13 @@ jobs:
287287
envVars: |
288288
RESTATE_WORKER__INVOKER__experimental_features_allow_protocol_v6=true
289289
RESTATE_EXPERIMENTAL_FEATURE__USE_JOURNAL_V2_BY_DEFAULT=true
290+
# Disable BackCompatibilityTest. But why this test is disabled?
291+
# In restate 1.5 the invoker storage reader will not handle correctly the case where there's no pinned deployment yet
292+
# and the journal table used is v2. This doesn't show in the logs, but will simply hang badly the invocation task loop!
293+
exclusions: |
294+
exclusions:
295+
"versionCompat":
296+
- "dev.restate.sdktesting.tests.BackCompatibilityTest"
290297
291298
jepsen:
292299
if: github.event.repository.fork == false && github.event.pull_request.head.repo.full_name == 'restatedev/restate' && github.ref == 'refs/heads/main'

crates/invoker-impl/src/error.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ pub(crate) enum InvokerError {
119119
actual: InvocationEpoch,
120120
expected: InvocationEpoch,
121121
},
122+
#[error(
123+
"error when reading the journal: expected to read {expected} entries, but read only {expected}. This indicates a bug or a storage corruption."
124+
)]
125+
#[code(unknown)]
126+
UnexpectedEntryCount { actual: u32, expected: u32 },
122127

123128
#[error(transparent)]
124129
#[code(restate_errors::RT0010)]

crates/invoker-impl/src/invocation_task/service_protocol_runner_v4.rs

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,13 @@ where
184184

185185
// Execute the replay
186186
crate::shortcircuit!(
187-
self.replay_loop(&mut http_stream_tx, &mut decoder_stream, journal_stream)
188-
.await
187+
self.replay_loop(
188+
&mut http_stream_tx,
189+
&mut decoder_stream,
190+
journal_stream,
191+
journal_metadata.length
192+
)
193+
.await
189194
);
190195

191196
// If we have the invoker_rx and the protocol type is bidi stream,
@@ -305,13 +310,15 @@ where
305310
http_stream_tx: &mut InvokerRequestStreamSender,
306311
http_stream_rx: &mut S,
307312
journal_stream: JournalStream,
313+
expected_entries_count: u32,
308314
) -> TerminalLoopState<()>
309315
where
310316
JournalStream: Stream<Item = JournalEntry> + Unpin,
311317
S: Stream<Item = Result<DecoderStreamItem, InvokerError>> + Unpin,
312318
{
313319
let mut journal_stream = journal_stream.fuse();
314320
let mut got_headers = false;
321+
let mut sent_entries = 0;
315322

316323
loop {
317324
tokio::select! {
@@ -334,10 +341,11 @@ where
334341
opt_je = journal_stream.next() => {
335342
match opt_je {
336343
Some(JournalEntry::JournalV2(entry)) => {
344+
sent_entries += 1;
337345
crate::shortcircuit!(self.write_entry(http_stream_tx, entry.inner).await);
338-
339346
}
340347
Some(JournalEntry::JournalV1(old_entry)) => {
348+
sent_entries += 1;
341349
if let journal::Entry::Input(input_entry) = crate::shortcircuit!(old_entry.deserialize_entry::<ProtobufRawEntryCodec>()) {
342350
crate::shortcircuit!(self.write_entry(
343351
http_stream_tx,
@@ -352,6 +360,14 @@ where
352360
}
353361
},
354362
None => {
363+
// Let's verify if we sent all the entries we promised, otherwise the stream will hang in a bad way!
364+
if sent_entries < expected_entries_count {
365+
return TerminalLoopState::Failed(InvokerError::UnexpectedEntryCount {
366+
actual: sent_entries,
367+
expected: expected_entries_count,
368+
})
369+
}
370+
355371
// No need to wait for the headers to continue
356372
trace!("Finished to replay the journal");
357373
return TerminalLoopState::Continue(())

0 commit comments

Comments
 (0)