You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "BenEddy (via GitHub)" <gi...@apache.org> on 2024/09/12 00:01:36 UTC
[PR] Add query attempt interceptor [cassandra-gocql-driver]
BenEddy opened a new pull request, #1820:
URL: https://github.com/apache/cassandra-gocql-driver/pull/1820
As suggested in https://github.com/apache/cassandra-gocql-driver/issues/1786, this PR introduces a `QueryAttemptInterceptor` interface for intercepting query attempts, which allows clients to inject logic that should apply to all queries e.g. context manipulation, rate limiting, query modification, logging, fault injection, metrics, etc.
Alternative to https://github.com/apache/cassandra-gocql-driver/pull/1810.
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] Add query attempt interceptor [cassandra-gocql-driver]
Posted by "ribaraka (via GitHub)" <gi...@apache.org>.
ribaraka commented on code in PR #1820:
URL: https://github.com/apache/cassandra-gocql-driver/pull/1820#discussion_r1825813177
##########
example_interceptor_test.go:
##########
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/*
+ * Content before git sha 34fdeebefcbf183ed7f916f931aa0586fdaa1b40
+ * Copyright (c) 2016, The Gocql authors,
+ * provided under the BSD-3-Clause License.
+ * See the NOTICE file distributed with this work for additional information.
+ */
+
+package gocql_test
+
+import (
+ "context"
+ "log"
+ "time"
+
+ gocql "github.com/gocql/gocql"
+)
+
+type MyQueryAttemptInterceptor struct {
+ injectFault bool
+}
+
+func (q MyQueryAttemptInterceptor) Intercept(
+ ctx context.Context,
+ attempt gocql.QueryAttempt,
+ handler gocql.QueryAttemptHandler,
+) (*gocql.Iter, error) {
+ switch q := attempt.Query.(type) {
+ case *gocql.Query:
+ // Inspect or modify query
+ attempt.Query = q
+ case *gocql.Batch:
+ // Inspect or modify batch
+ attempt.Query = q
+ }
+
+ // Inspect or modify context
+ ctx = context.WithValue(ctx, "trace-id", "123")
+
+ // Optionally bypass the handler and return an error to prevent query execution.
+ // For example, to simulate query timeouts.
+ if q.injectFault && attempt.Attempts == 0 {
+ <-time.After(1 * time.Second)
+ return nil, gocql.RequestErrWriteTimeout{}
+ }
+
+ // The interceptor *must* invoke the handler to execute the query.
+ return handler(ctx, attempt), nil
+}
+
+// Example_interceptor demonstrates how to implement a QueryAttemptInterceptor.
+func Example_interceptor() {
+ cluster := gocql.NewCluster("localhost:9042")
+ cluster.QueryAttemptInterceptor = MyQueryAttemptInterceptor{injectFault: true}
+
+ session, err := cluster.CreateSession()
+ if err != nil {
+ log.Fatal(err)
+ }
+ defer session.Close()
+
+ ctx := context.Background()
+
+ var stringValue string
+ err = session.Query("select now() from system.local").
+ WithContext(ctx).
+ RetryPolicy(&gocql.SimpleRetryPolicy{NumRetries: 2}).
+ Scan(&stringValue)
+ if err != nil {
Review Comment:
How about adding an option to apply the interceptor selectively to specific queries, like `.WithInterceptor()` method to the Query struct?
##########
query_executor.go:
##########
@@ -48,16 +48,64 @@ type ExecutableQuery interface {
}
type queryExecutor struct {
- pool *policyConnPool
- policy HostSelectionPolicy
+ pool *policyConnPool
+ policy HostSelectionPolicy
+ interceptor QueryAttemptInterceptor
+}
+
+type QueryAttempt struct {
+ // The query to execute, either a *gocql.Query or *gocql.Batch.
+ Query ExecutableQuery
+ // The connection used to execute the query.
+ Conn *Conn
+ // The host that will receive the query.
+ Host *HostInfo
Review Comment:
Do we need to add and expose these fields in `QueryAttempt`?
If there’s no compelling need for direct connection manipulation, then maybe we could expose only a connection metadata that’s relevant for logging or monitoring purposes?
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] Add query attempt interceptor [cassandra-gocql-driver]
Posted by "martin-sucha (via GitHub)" <gi...@apache.org>.
martin-sucha commented on code in PR #1820:
URL: https://github.com/apache/cassandra-gocql-driver/pull/1820#discussion_r1758548535
##########
example_interceptor_test.go:
##########
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/*
+ * Content before git sha 34fdeebefcbf183ed7f916f931aa0586fdaa1b40
+ * Copyright (c) 2016, The Gocql authors,
+ * provided under the BSD-3-Clause License.
+ * See the NOTICE file distributed with this work for additional information.
+ */
+
+package gocql_test
+
+import (
+ "context"
+ "fmt"
+ "log"
+ "time"
+
+ gocql "github.com/gocql/gocql"
+)
+
+type MyQueryAttemptInterceptor struct {
+ injectFault bool
+}
+
+func (q MyQueryAttemptInterceptor) Intercept(
+ ctx context.Context,
+ query gocql.ExecutableQuery,
+ conn *gocql.Conn,
+ handler gocql.QueryAttemptHandler,
+) *gocql.Iter {
+ switch q := query.(type) {
+ case *gocql.Query:
+ // Inspect or modify query
+ query = q
+ case *gocql.Batch:
+ // Inspect or modify batch
+ query = q
+ }
+
+ // Inspect or modify context
+ ctx = context.WithValue(ctx, "trace-id", "123")
+
+ // Optionally bypass the handler and return an error to prevent query execution.
+ // For example, to simulate query timeouts.
+ if q.injectFault && query.Attempts() == 0 {
Review Comment:
Should the attempt number be a parameter to `Intercept`? It seems that calling `Attempts()` could be racy, especially when speculative execution is enabled:
1. Attempt 0 started
2. Attempt 1 started
3. Interceptor 0 called - gets attempt 0
4. Interceptor 1 called - gets attempt 0
5. attempts incremented
6. attempts incremented
Perhaps the signature should be `Intercept(ctx context.Context, attempt gocql.QueryAttempt, handler gocql.QueryAttemptHandler)`? That would enable adding more information about the attempt in the future.
```go
type QueryAttempt struct {
// query to execute
query gocql.ExecutableQuery
// conn to use to execute the query
conn *gocql.Conn
// number of the attempt. 0 is the initial attempt, 1 is first retry, etc.
number int
}
```
```go
type QueryAttemptHandler = func(context.Context, QueryAttempt) *Iter
```
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] CASSGO-39 Add query attempt interceptor [cassandra-gocql-driver]
Posted by "BenEddy (via GitHub)" <gi...@apache.org>.
BenEddy commented on code in PR #1820:
URL: https://github.com/apache/cassandra-gocql-driver/pull/1820#discussion_r1866728349
##########
example_interceptor_test.go:
##########
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/*
+ * Content before git sha 34fdeebefcbf183ed7f916f931aa0586fdaa1b40
+ * Copyright (c) 2016, The Gocql authors,
+ * provided under the BSD-3-Clause License.
+ * See the NOTICE file distributed with this work for additional information.
+ */
+
+package gocql_test
+
+import (
+ "context"
+ "log"
+ "time"
+
+ gocql "github.com/gocql/gocql"
+)
+
+type MyQueryAttemptInterceptor struct {
+ injectFault bool
+}
+
+func (q MyQueryAttemptInterceptor) Intercept(
+ ctx context.Context,
+ attempt gocql.QueryAttempt,
+ handler gocql.QueryAttemptHandler,
+) (*gocql.Iter, error) {
+ switch q := attempt.Query.(type) {
+ case *gocql.Query:
+ // Inspect or modify query
+ attempt.Query = q
+ case *gocql.Batch:
+ // Inspect or modify batch
+ attempt.Query = q
+ }
+
+ // Inspect or modify context
+ ctx = context.WithValue(ctx, "trace-id", "123")
+
+ // Optionally bypass the handler and return an error to prevent query execution.
+ // For example, to simulate query timeouts.
+ if q.injectFault && attempt.Attempts == 0 {
+ <-time.After(1 * time.Second)
+ return nil, gocql.RequestErrWriteTimeout{}
+ }
+
+ // The interceptor *must* invoke the handler to execute the query.
+ return handler(ctx, attempt), nil
+}
+
+// Example_interceptor demonstrates how to implement a QueryAttemptInterceptor.
+func Example_interceptor() {
+ cluster := gocql.NewCluster("localhost:9042")
+ cluster.QueryAttemptInterceptor = MyQueryAttemptInterceptor{injectFault: true}
+
+ session, err := cluster.CreateSession()
+ if err != nil {
+ log.Fatal(err)
+ }
+ defer session.Close()
+
+ ctx := context.Background()
+
+ var stringValue string
+ err = session.Query("select now() from system.local").
+ WithContext(ctx).
+ RetryPolicy(&gocql.SimpleRetryPolicy{NumRetries: 2}).
+ Scan(&stringValue)
+ if err != nil {
Review Comment:
Not strongly opposed, but I'd favor using the query `context` to selectively enable an interceptor because it avoids introducing potential conflicts between a session-level interceptor config and query-level interceptor config.
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] Add query attempt interceptor [cassandra-gocql-driver]
Posted by "joao-r-reis (via GitHub)" <gi...@apache.org>.
joao-r-reis commented on PR #1820:
URL: https://github.com/apache/cassandra-gocql-driver/pull/1820#issuecomment-2493785895
Rate limiting should probably also be handled in a different component with its own interface dedicated to rate limiting/throttling
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] Add query attempt interceptor [cassandra-gocql-driver]
Posted by "BenEddy (via GitHub)" <gi...@apache.org>.
BenEddy commented on code in PR #1820:
URL: https://github.com/apache/cassandra-gocql-driver/pull/1820#discussion_r1759294645
##########
example_interceptor_test.go:
##########
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/*
+ * Content before git sha 34fdeebefcbf183ed7f916f931aa0586fdaa1b40
+ * Copyright (c) 2016, The Gocql authors,
+ * provided under the BSD-3-Clause License.
+ * See the NOTICE file distributed with this work for additional information.
+ */
+
+package gocql_test
+
+import (
+ "context"
+ "fmt"
+ "log"
+ "time"
+
+ gocql "github.com/gocql/gocql"
+)
+
+type MyQueryAttemptInterceptor struct {
+ injectFault bool
+}
+
+func (q MyQueryAttemptInterceptor) Intercept(
+ ctx context.Context,
+ query gocql.ExecutableQuery,
+ conn *gocql.Conn,
+ handler gocql.QueryAttemptHandler,
+) *gocql.Iter {
+ switch q := query.(type) {
+ case *gocql.Query:
+ // Inspect or modify query
+ query = q
+ case *gocql.Batch:
+ // Inspect or modify batch
+ query = q
+ }
+
+ // Inspect or modify context
+ ctx = context.WithValue(ctx, "trace-id", "123")
+
+ // Optionally bypass the handler and return an error to prevent query execution.
+ // For example, to simulate query timeouts.
+ if q.injectFault && query.Attempts() == 0 {
Review Comment:
@martin-sucha passing a `QueryAttempt` type seems like a great way to keep the interceptor API stable 👍
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] Add query attempt interceptor [cassandra-gocql-driver]
Posted by "BenEddy (via GitHub)" <gi...@apache.org>.
BenEddy commented on code in PR #1820:
URL: https://github.com/apache/cassandra-gocql-driver/pull/1820#discussion_r1764070836
##########
query_executor.go:
##########
@@ -48,16 +48,60 @@ type ExecutableQuery interface {
}
type queryExecutor struct {
- pool *policyConnPool
- policy HostSelectionPolicy
+ pool *policyConnPool
+ policy HostSelectionPolicy
+ interceptor QueryAttemptInterceptor
+}
+
+type QueryAttempt struct {
+ // The query to execute, either a *gocql.Query or *gocql.Batch.
+ Query ExecutableQuery
+ // The connection used to execute the query.
+ Conn *Conn
+ // The host that will receive the query.
+ Host *HostInfo
+ // The number of previous query attempts. 0 for the initial attempt, 1 for the first retry, etc.
+ Attempts int
+}
+
+// QueryAttemptHandler is a function that attempts query execution.
+type QueryAttemptHandler = func(context.Context, QueryAttempt) *Iter
+
+// QueryAttemptInterceptor is the interface implemented by query interceptors / middleware.
+//
+// Interceptors are well-suited to logic that is not specific to a single query or batch.
+type QueryAttemptInterceptor interface {
+ // Intercept is invoked once immediately before a query execution attempt, including retry attempts and
+ // speculative execution attempts.
+
+ // The interceptor is responsible for calling the `handler` function and returning the handler result. Failure to
+ // call the handler will panic. If the interceptor wants to halt query execution and prevent retries, it should
+ // return an error.
Review Comment:
> Should we add an error return value or should we reference `NewIterWithErr` instead?
Updated `Intercept` to optionally return an error and removed `NewIterWithErr`.
> How does returning an error prevent a retry?
Returning a non-retriable error like `context.Canceled` would prevent retries, but admittedly that's not clear from the function docs. I removed the reference to preventing retries and will assume that users can probably figure out how to configure retry policies with whatever error handling and retry prevention makes sense for them.
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] CASSGO-39 Add query attempt interceptor [cassandra-gocql-driver]
Posted by "BenEddy (via GitHub)" <gi...@apache.org>.
BenEddy commented on code in PR #1820:
URL: https://github.com/apache/cassandra-gocql-driver/pull/1820#discussion_r1866725275
##########
query_executor.go:
##########
@@ -48,16 +48,64 @@ type ExecutableQuery interface {
}
type queryExecutor struct {
- pool *policyConnPool
- policy HostSelectionPolicy
+ pool *policyConnPool
+ policy HostSelectionPolicy
+ interceptor QueryAttemptInterceptor
+}
+
+type QueryAttempt struct {
+ // The query to execute, either a *gocql.Query or *gocql.Batch.
+ Query ExecutableQuery
+ // The connection used to execute the query.
+ Conn *Conn
+ // The host that will receive the query.
+ Host *HostInfo
Review Comment:
Removed the `Conn` field in favor of read-only `LocalAddr` and `RemoteAddr` connection metadata fields, but retained the `Host` field to match `ObservedQuery`.
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] Add query attempt interceptor [cassandra-gocql-driver]
Posted by "ribaraka (via GitHub)" <gi...@apache.org>.
ribaraka commented on PR #1820:
URL: https://github.com/apache/cassandra-gocql-driver/pull/1820#issuecomment-2493631620
https://issues.apache.org/jira/browse/CASSGO-39
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] CASSGO-39 Add query attempt interceptor [cassandra-gocql-driver]
Posted by "joao-r-reis (via GitHub)" <gi...@apache.org>.
joao-r-reis commented on PR #1820:
URL: https://github.com/apache/cassandra-gocql-driver/pull/1820#issuecomment-2752111641
Since this PR doesn't require breaking changes to the API we can take a look at this in a minor release after 2.0.
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] Add query attempt interceptor [cassandra-gocql-driver]
Posted by "martin-sucha (via GitHub)" <gi...@apache.org>.
martin-sucha commented on code in PR #1820:
URL: https://github.com/apache/cassandra-gocql-driver/pull/1820#discussion_r1760656947
##########
query_executor.go:
##########
@@ -48,16 +48,60 @@ type ExecutableQuery interface {
}
type queryExecutor struct {
- pool *policyConnPool
- policy HostSelectionPolicy
+ pool *policyConnPool
+ policy HostSelectionPolicy
+ interceptor QueryAttemptInterceptor
+}
+
+type QueryAttempt struct {
+ // The query to execute, either a *gocql.Query or *gocql.Batch.
+ Query ExecutableQuery
+ // The connection used to execute the query.
+ Conn *Conn
+ // The host that will receive the query.
+ Host *HostInfo
+ // The number of previous query attempts. 0 for the initial attempt, 1 for the first retry, etc.
+ Attempts int
+}
+
+// QueryAttemptHandler is a function that attempts query execution.
+type QueryAttemptHandler = func(context.Context, QueryAttempt) *Iter
+
+// QueryAttemptInterceptor is the interface implemented by query interceptors / middleware.
+//
+// Interceptors are well-suited to logic that is not specific to a single query or batch.
+type QueryAttemptInterceptor interface {
+ // Intercept is invoked once immediately before a query execution attempt, including retry attempts and
+ // speculative execution attempts.
+
+ // The interceptor is responsible for calling the `handler` function and returning the handler result. Failure to
+ // call the handler will panic. If the interceptor wants to halt query execution and prevent retries, it should
+ // return an error.
Review Comment:
**nitpick**: The function does not have an `error` return value. Should we add an error return value or should we reference `NewIterWithErr` instead?
**question**: How does returning an error prevent a retry?
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] Add query attempt interceptor [cassandra-gocql-driver]
Posted by "joao-r-reis (via GitHub)" <gi...@apache.org>.
joao-r-reis commented on PR #1820:
URL: https://github.com/apache/cassandra-gocql-driver/pull/1820#issuecomment-2493782120
I don't know if I like the idea of having an `interceptor` that can modify the query/batch after it has already been submitted to the driver. Having something like the equivalent of a request tracker in the java driver would be nice but the goal there would be to inspect the queries, not modify them. Modifying query/batch also goes against #1447 which is being worked on atm.
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] Add query attempt interceptor [cassandra-gocql-driver]
Posted by "joao-r-reis (via GitHub)" <gi...@apache.org>.
joao-r-reis commented on PR #1820:
URL: https://github.com/apache/cassandra-gocql-driver/pull/1820#issuecomment-2493806706
Hmm taking another look at #1786 it seems that the focus is indeed to be an interface generic enough to serve as a way to implement stuff like request limiting or query modification while the inspection stuff could be handled by the observers that we already have.
In that case we need to make sure the changes here are consistent with changes in #1447
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org