MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / commit_unregistered_table

Function commit_unregistered_table

src/txn-wal/src/txn_write.rs:654–686  ·  view source on GitHub ↗

unsupported operation: returning ready events from epoll_wait is not yet implemented

()

Source from the content-addressed store, hash-verified

652 #[mz_ore::test(tokio::test)]
653 #[cfg_attr(miri, ignore)] // unsupported operation: returning ready events from epoll_wait is not yet implemented
654 async fn commit_unregistered_table() {
655 let client = PersistClient::new_for_tests().await;
656 let mut txns = TxnsHandle::expect_open(client.clone()).await;
657
658 // This panics because the commit ts is before the register ts.
659 let commit = mz_ore::task::spawn(|| "", {
660 let (txns_id, client) = (txns.txns_id(), client.clone());
661 async move {
662 let mut txns = TxnsHandle::expect_open_id(client, txns_id).await;
663 let mut txn = txns.begin();
664 txn.write(&ShardId::new(), "foo".into(), (), 1).await;
665 txn.commit_at(&mut txns, 1).await
666 }
667 })
668 .into_tokio_handle();
669 assert_err!(commit.await);
670
671 let d0 = txns.expect_register(2).await;
672 txns.forget(3, [d0]).await.unwrap();
673
674 // This panics because the commit ts is after the forget ts.
675 let commit = mz_ore::task::spawn(|| "", {
676 let (txns_id, client) = (txns.txns_id(), client.clone());
677 async move {
678 let mut txns = TxnsHandle::expect_open_id(client, txns_id).await;
679 let mut txn = txns.begin();
680 txn.write(&d0, "foo".into(), (), 1).await;
681 txn.commit_at(&mut txns, 4).await
682 }
683 })
684 .into_tokio_handle();
685 assert_err!(commit.await);
686 }
687
688 #[mz_ore::test(tokio::test)]
689 #[cfg_attr(miri, ignore)] // too slow

Callers

nothing calls this directly

Calls 10

spawnFunction · 0.85
into_tokio_handleMethod · 0.80
expect_registerMethod · 0.80
unwrapMethod · 0.80
forgetMethod · 0.80
cloneMethod · 0.45
txns_idMethod · 0.45
beginMethod · 0.45
writeMethod · 0.45
commit_atMethod · 0.45

Tested by

no test coverage detected