You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "xtern (via GitHub)" <gi...@apache.org> on 2025/09/08 11:27:34 UTC
[PR] IGNITE-26146 Abort connection to the old server (WIP). [ignite-3]
xtern opened a new pull request, #6566:
URL: https://github.com/apache/ignite-3/pull/6566
(no comment)
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-26146 Sql. Jdbc. Abort the connection to a node that does not support a feature required by the new JDBC driver [ignite-3]
Posted by "korlov42 (via GitHub)" <gi...@apache.org>.
korlov42 commented on code in PR #6566:
URL: https://github.com/apache/ignite-3/pull/6566#discussion_r2476629275
##########
modules/jdbc/src/main/java/org/apache/ignite/jdbc/IgniteJdbcDriver.java:
##########
@@ -316,8 +316,9 @@ private static TcpIgniteClient createIgniteClient(
throw new IgniteClientConnectionException(
CONNECTION_ERR,
- IgniteStringFormatter.format("Connection to node aborted, "
- + "because node doesn't support new JDBC driver [name={}, address={}]", node.name(), node.address()),
+ IgniteStringFormatter.format("Connection to node aborted, because the node does not support "
+ + "the feature required by the driver being used. Please use a previous version of the JDBC driver "
Review Comment:
`previous version` sounds to vague. New driver will probably be released in Ignite 3.2. So, if I use driver of version 3.3 and try to connect to server of version 3.1, how could I understand that previous refer to 3.1 and not 3.2?
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-26146 Sql. Jdbc. Abort the connection to a node that does not support a feature required by the new JDBC driver [ignite-3]
Posted by "xtern (via GitHub)" <gi...@apache.org>.
xtern commented on code in PR #6566:
URL: https://github.com/apache/ignite-3/pull/6566#discussion_r2480291545
##########
modules/jdbc/src/main/java/org/apache/ignite/jdbc/IgniteJdbcDriver.java:
##########
@@ -316,8 +316,9 @@ private static TcpIgniteClient createIgniteClient(
throw new IgniteClientConnectionException(
CONNECTION_ERR,
- IgniteStringFormatter.format("Connection to node aborted, "
- + "because node doesn't support new JDBC driver [name={}, address={}]", node.name(), node.address()),
+ IgniteStringFormatter.format("Connection to node aborted, because the node does not support "
+ + "the feature required by the driver being used. Please use a previous version of the JDBC driver "
Review Comment:
Changed to "compatible version".
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-26146 Sql. Jdbc. Abort the connection to a node that does not support a feature required by the new JDBC driver [ignite-3]
Posted by "korlov42 (via GitHub)" <gi...@apache.org>.
korlov42 commented on code in PR #6566:
URL: https://github.com/apache/ignite-3/pull/6566#discussion_r2486258089
##########
modules/jdbc/src/main/java/org/apache/ignite/jdbc/IgniteJdbcDriver.java:
##########
@@ -302,7 +309,23 @@ private static TcpIgniteClient createIgniteClient(
IgniteClientConfiguration.DFLT_SQL_PARTITION_AWARENESS_METADATA_CACHE_SIZE
);
- return (TcpIgniteClient) sync(TcpIgniteClient.startAsync(cfg, observableTimeTracker));
+ ChannelValidator channelValidator = ctx -> {
+ if (!ctx.isFeatureSupported(ProtocolBitmaskFeature.SQL_MULTISTATEMENT_SUPPORT)) {
+ ClusterNode node = ctx.clusterNode();
+
+ throw new IgniteClientConnectionException(
+ CONNECTION_ERR,
+ IgniteStringFormatter.format("Connection to node aborted, because the node does not support "
+ + "the feature required by the driver being used. Please refer to the documentation and use a compatible "
+ + "version of the JDBC driver to connect to this node [name={}, address={}, productVersion={}]",
+ node.name(), node.address(), ctx.productVersion()),
Review Comment:
let's also include version of the driver
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-26146 [ignite-3]
Posted by "ptupitsyn (via GitHub)" <gi...@apache.org>.
ptupitsyn commented on code in PR #6566:
URL: https://github.com/apache/ignite-3/pull/6566#discussion_r2448465807
##########
modules/client/src/main/java/org/apache/ignite/internal/client/ReliableChannel.java:
##########
@@ -918,6 +930,14 @@ private CompletableFuture<ClientChannel> getOrCreateChannelAsync() {
nodeChannelsByName.remove(oldServerNode.name(), this);
}
+ if (requiredFeature != null && !ch.protocolContext().isFeatureSupported(requiredFeature)) {
+ throw new IgniteClientConnectionException(
Review Comment:
Let's make sure to close the channel here.
##########
modules/client/src/main/java/org/apache/ignite/internal/client/ReliableChannel.java:
##########
@@ -568,7 +576,7 @@ private synchronized boolean initChannelHolders() {
// Create new holders for new addrs.
if (!curAddrs.containsKey(addr)) {
- ClientChannelHolder hld = new ClientChannelHolder(new ClientChannelConfiguration(clientCfg, addr));
+ ClientChannelHolder hld = new ClientChannelHolder(new ClientChannelConfiguration(clientCfg, addr), requiredFeature);
Review Comment:
`ClientChannelHolder` is not static and should be able to access `requiredFeature`?
##########
modules/client/src/main/java/org/apache/ignite/internal/client/ReliableChannel.java:
##########
@@ -133,24 +134,31 @@ public final class ReliableChannel implements AutoCloseable {
/** Inflights. */
private final ClientTransactionInflights inflights;
+ /** The feature that the node must support in order to connect to it. */
+ private final @Nullable ProtocolBitmaskFeature requiredFeature;
+
/**
* Constructor.
*
* @param chFactory Channel factory.
* @param clientCfg Client config.
* @param metrics Client metrics.
* @param observableTimeTracker Tracker of the latest time observed by client.
+ * @param requiredFeature The feature that the node must support in order to connect to it.
*/
ReliableChannel(
ClientChannelFactory chFactory,
IgniteClientConfiguration clientCfg,
ClientMetricSource metrics,
- HybridTimestampTracker observableTimeTracker) {
+ HybridTimestampTracker observableTimeTracker,
+ @Nullable ProtocolBitmaskFeature requiredFeature
Review Comment:
Might be something more generic like `Consumer<ProtocolContext> channelValidatior`
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-26146 Sql. Jdbc. Abort the connection to a node that does not support a feature required by the new JDBC driver [ignite-3]
Posted by "xtern (via GitHub)" <gi...@apache.org>.
xtern commented on code in PR #6566:
URL: https://github.com/apache/ignite-3/pull/6566#discussion_r2454664853
##########
modules/client/src/main/java/org/apache/ignite/internal/client/ReliableChannel.java:
##########
@@ -133,24 +134,31 @@ public final class ReliableChannel implements AutoCloseable {
/** Inflights. */
private final ClientTransactionInflights inflights;
+ /** The feature that the node must support in order to connect to it. */
+ private final @Nullable ProtocolBitmaskFeature requiredFeature;
+
/**
* Constructor.
*
* @param chFactory Channel factory.
* @param clientCfg Client config.
* @param metrics Client metrics.
* @param observableTimeTracker Tracker of the latest time observed by client.
+ * @param requiredFeature The feature that the node must support in order to connect to it.
*/
ReliableChannel(
ClientChannelFactory chFactory,
IgniteClientConfiguration clientCfg,
ClientMetricSource metrics,
- HybridTimestampTracker observableTimeTracker) {
+ HybridTimestampTracker observableTimeTracker,
+ @Nullable ProtocolBitmaskFeature requiredFeature
Review Comment:
Thanks. Replaced with `Consumer<ProtocolContext> channelValidatior`.
##########
modules/client/src/main/java/org/apache/ignite/internal/client/ReliableChannel.java:
##########
@@ -568,7 +576,7 @@ private synchronized boolean initChannelHolders() {
// Create new holders for new addrs.
if (!curAddrs.containsKey(addr)) {
- ClientChannelHolder hld = new ClientChannelHolder(new ClientChannelConfiguration(clientCfg, addr));
+ ClientChannelHolder hld = new ClientChannelHolder(new ClientChannelConfiguration(clientCfg, addr), requiredFeature);
Review Comment:
Fixed, thanks
##########
modules/client/src/main/java/org/apache/ignite/internal/client/ReliableChannel.java:
##########
@@ -918,6 +930,14 @@ private CompletableFuture<ClientChannel> getOrCreateChannelAsync() {
nodeChannelsByName.remove(oldServerNode.name(), this);
}
+ if (requiredFeature != null && !ch.protocolContext().isFeatureSupported(requiredFeature)) {
+ throw new IgniteClientConnectionException(
Review Comment:
The channel will be closed in the exception handling block.
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-26146 Sql. Jdbc. Abort the connection to a node that does not support a feature required by the new JDBC driver [ignite-3]
Posted by "xtern (via GitHub)" <gi...@apache.org>.
xtern commented on code in PR #6566:
URL: https://github.com/apache/ignite-3/pull/6566#discussion_r2480291545
##########
modules/jdbc/src/main/java/org/apache/ignite/jdbc/IgniteJdbcDriver.java:
##########
@@ -316,8 +316,9 @@ private static TcpIgniteClient createIgniteClient(
throw new IgniteClientConnectionException(
CONNECTION_ERR,
- IgniteStringFormatter.format("Connection to node aborted, "
- + "because node doesn't support new JDBC driver [name={}, address={}]", node.name(), node.address()),
+ IgniteStringFormatter.format("Connection to node aborted, because the node does not support "
+ + "the feature required by the driver being used. Please use a previous version of the JDBC driver "
Review Comment:
Changed to "compatible" version.
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-26146 Sql. Jdbc. Abort the connection to a node that does not support a feature required by the new JDBC driver [ignite-3]
Posted by "korlov42 (via GitHub)" <gi...@apache.org>.
korlov42 commented on code in PR #6566:
URL: https://github.com/apache/ignite-3/pull/6566#discussion_r2465719697
##########
modules/client/src/main/java/org/apache/ignite/internal/client/ReliableChannel.java:
##########
@@ -133,24 +134,35 @@ public final class ReliableChannel implements AutoCloseable {
/** Inflights. */
private final ClientTransactionInflights inflights;
+ /**
+ * A validator that is called when a connection to a node is established,
+ * if it throws an exception, the network channel to that node will be closed.
+ */
+ private final @Nullable Consumer<ProtocolContext> channelValidator;
Review Comment:
nitpicking: rather than using generic `Consumer`, I would introduce interface `ChannelValidator`, and encapsulate external check of mandatory features and internal cluster Id validation
##########
modules/client/src/main/java/org/apache/ignite/internal/client/ReliableChannel.java:
##########
@@ -918,6 +930,10 @@ private CompletableFuture<ClientChannel> getOrCreateChannelAsync() {
nodeChannelsByName.remove(oldServerNode.name(), this);
}
+ if (channelValidator != null) {
Review Comment:
I think, any validation must come before any change of internal state (see updates of `nodeChannelsByName `)
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-26146 Sql. Jdbc. Abort the connection to a node that does not support a feature required by the new JDBC driver [ignite-3]
Posted by "xtern (via GitHub)" <gi...@apache.org>.
xtern merged PR #6566:
URL: https://github.com/apache/ignite-3/pull/6566
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-26146 Sql. Jdbc. Abort the connection to a node that does not support a feature required by the new JDBC driver [ignite-3]
Posted by "xtern (via GitHub)" <gi...@apache.org>.
xtern commented on code in PR #6566:
URL: https://github.com/apache/ignite-3/pull/6566#discussion_r2480292460
##########
modules/client/src/main/java/org/apache/ignite/internal/client/ReliableChannel.java:
##########
@@ -133,24 +134,35 @@ public final class ReliableChannel implements AutoCloseable {
/** Inflights. */
private final ClientTransactionInflights inflights;
+ /**
+ * A validator that is called when a connection to a node is established,
+ * if it throws an exception, the network channel to that node will be closed.
+ */
+ private final @Nullable Consumer<ProtocolContext> channelValidator;
Review Comment:
Separate interface `ChannelValidator` introduced, please take a look
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org