jiacai2050 commented on code in PR #1507:
URL:
https://github.com/apache/incubator-horaedb/pull/1507#discussion_r1543946111
##########
integration_tests/sdk/rust/src/main.rs:
##########
@@ -117,11 +119,71 @@ async fn test_add_column(
sql_query(client, rpc_ctx, timestamp, test_datas, true).await;
}
-async fn drop_table_if_exists(client: &Arc<dyn DbClient>, rpc_ctx:
&RpcContext, timestamp: i64) {
+async fn test_block_table(client: &Arc<dyn DbClient>, rpc_ctx: &RpcContext,
timestamp: i64) {
Review Comment:
It's a little heavy to put this logic here, sqlness could handle this?
##########
src/proxy/src/write.rs:
##########
@@ -506,7 +506,35 @@ impl Proxy {
.await?;
let mut success = 0;
- for insert_plan in plan_vec {
+
+ // TODO: concurrently run the insert plan here
+ for plan in plan_vec {
+ // check limit first
+ // TODO: if one table is blocked, maybe should not lead to failure
of whole
+ // batch?
+ self.instance
+ .limiter
+ .try_limit(&plan)
+ .box_err()
+ .context(ErrWithCause {
+ code: StatusCode::INTERNAL_SERVER_ERROR,
+ msg: "table is blocked",
+ })?;
+
+ let insert_plan = match plan {
Review Comment:
This check seems unnecessary, we could move this `try_limit` inside
`write_request_to_insert_plan`, so you don't need to do this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]