You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@horaedb.apache.org by "Rachelint (via GitHub)" <gi...@apache.org> on 2024/03/28 09:31:26 UTC
[PR] fix: fix table blocking in grpc write path [incubator-horaedb]
Rachelint opened a new pull request, #1507:
URL: https://github.com/apache/incubator-horaedb/pull/1507
## Rationale
## Detailed Changes
## Test Plan
--
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: commits-unsubscribe@horaedb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@horaedb.apache.org
For additional commands, e-mail: commits-help@horaedb.apache.org
Re: [PR] fix: table blacklist not work for write [incubator-horaedb]
Posted by "jiacai2050 (via GitHub)" <gi...@apache.org>.
jiacai2050 merged PR #1507:
URL: https://github.com/apache/incubator-horaedb/pull/1507
--
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: commits-unsubscribe@horaedb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@horaedb.apache.org
For additional commands, e-mail: commits-help@horaedb.apache.org
Re: [PR] fix: table blacklist not work for write [incubator-horaedb]
Posted by "Rachelint (via GitHub)" <gi...@apache.org>.
Rachelint commented on code in PR #1507:
URL: https://github.com/apache/incubator-horaedb/pull/1507#discussion_r1544100093
##########
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:
I think the steps should be:
- build plan
- check plan
- execute the valid plan
It maybe strange to mixed build step and check step?
--
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: commits-unsubscribe@horaedb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@horaedb.apache.org
For additional commands, e-mail: commits-help@horaedb.apache.org
Re: [PR] fix: table blacklist not work for write [incubator-horaedb]
Posted by "Rachelint (via GitHub)" <gi...@apache.org>.
Rachelint commented on code in PR #1507:
URL: https://github.com/apache/incubator-horaedb/pull/1507#discussion_r1544093307
##########
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 is used to check if table blocking is enable in sdk side, I think place it in sdk test is resonable?
--
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: commits-unsubscribe@horaedb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@horaedb.apache.org
For additional commands, e-mail: commits-help@horaedb.apache.org
Re: [PR] fix: table blacklist not work for write [incubator-horaedb]
Posted by "jiacai2050 (via GitHub)" <gi...@apache.org>.
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: commits-unsubscribe@horaedb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@horaedb.apache.org
For additional commands, e-mail: commits-help@horaedb.apache.org
Re: [PR] fix: table blacklist not work for write [incubator-horaedb]
Posted by "Rachelint (via GitHub)" <gi...@apache.org>.
Rachelint commented on code in PR #1507:
URL: https://github.com/apache/incubator-horaedb/pull/1507#discussion_r1544093307
##########
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 is used to check if table blocking is enable in sdk write path, I think place it in sdk test is resonable?
--
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: commits-unsubscribe@horaedb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@horaedb.apache.org
For additional commands, e-mail: commits-help@horaedb.apache.org