This is an automated email from the ASF dual-hosted git repository.
ptupitsyn pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
The following commit(s) were added to refs/heads/main by this push:
new 4aff5f03433 IGNITE-26222 .NET: Improve debug logging for failed table
ops (#6452)
4aff5f03433 is described below
commit 4aff5f03433813d00486b4a200b9fdbff5196b76
Author: Pavel Tupitsyn <[email protected]>
AuthorDate: Wed Aug 27 17:37:24 2025 +0300
IGNITE-26222 .NET: Improve debug logging for failed table ops (#6452)
---
.../internal/client/ClientCompatibilityTests.java | 1 -
.../CurrentClientWithOldServerCompatibilityTest.java | 1 -
.../Apache.Ignite.Tests/Table/SchemaUpdateTest.cs | 20 +++++++++++++++++---
.../Apache.Ignite/Internal/ClientFailoverSocket.cs | 6 ++++++
.../dotnet/Apache.Ignite/Internal/LogMessages.cs | 7 +++++++
.../Apache.Ignite/Internal/Table/RecordView.cs | 6 ++++++
6 files changed, 36 insertions(+), 5 deletions(-)
diff --git
a/modules/compatibility-tests/src/integrationTest/java/org/apache/ignite/internal/client/ClientCompatibilityTests.java
b/modules/compatibility-tests/src/integrationTest/java/org/apache/ignite/internal/client/ClientCompatibilityTests.java
index 85b39eb4f01..ad9cfcb6ec0 100644
---
a/modules/compatibility-tests/src/integrationTest/java/org/apache/ignite/internal/client/ClientCompatibilityTests.java
+++
b/modules/compatibility-tests/src/integrationTest/java/org/apache/ignite/internal/client/ClientCompatibilityTests.java
@@ -84,7 +84,6 @@ public interface ClientCompatibilityTests {
AtomicInteger idGen();
default String tableNamePrefix() {
- // TODO IGNITE-25846 Remove this method, table name should be the same
across versions.
return "";
}
diff --git
a/modules/compatibility-tests/src/integrationTest/java/org/apache/ignite/internal/client/CurrentClientWithOldServerCompatibilityTest.java
b/modules/compatibility-tests/src/integrationTest/java/org/apache/ignite/internal/client/CurrentClientWithOldServerCompatibilityTest.java
index 51909f9f166..57f7114aed6 100644
---
a/modules/compatibility-tests/src/integrationTest/java/org/apache/ignite/internal/client/CurrentClientWithOldServerCompatibilityTest.java
+++
b/modules/compatibility-tests/src/integrationTest/java/org/apache/ignite/internal/client/CurrentClientWithOldServerCompatibilityTest.java
@@ -84,7 +84,6 @@ public class CurrentClientWithOldServerCompatibilityTest
extends CompatibilityTe
@Override
public String tableNamePrefix() {
- // TODO IGNITE-25846 Remove this method, table name should be the same
across versions.
return "PUBLIC.";
}
}
diff --git
a/modules/platforms/dotnet/Apache.Ignite.Tests/Table/SchemaUpdateTest.cs
b/modules/platforms/dotnet/Apache.Ignite.Tests/Table/SchemaUpdateTest.cs
index 2dd8fc43cac..840c68f0c27 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Tests/Table/SchemaUpdateTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Tests/Table/SchemaUpdateTest.cs
@@ -83,12 +83,26 @@ public class SchemaUpdateTest
var schemas = table.GetFieldValue<IDictionary<int,
Task<Schema>>>("_schemas");
// First operation fails because server drops connection.
- Assert.ThrowsAsync<IgniteClientConnectionException>(async () => await
view.UpsertAsync(null, new IgniteTuple { ["id"] = 1 }));
+ bool firstOpFailed = false;
+ try
+ {
+ await view.UpsertAsync(null, new IgniteTuple { ["id"] = 1 });
+ Console.WriteLine("Upsert success.");
+ }
+ catch (IgniteClientConnectionException expected)
+ {
+ firstOpFailed = true;
+ Console.WriteLine($"Upsert fail: {expected.Message}");
+ }
+
Assert.IsTrue(schemas[-1].IsFaulted);
// Second operation should ignore failed task and create a new one,
which will succeed.
await view.UpsertAsync(null, new IgniteTuple { ["id"] = 1 });
- Assert.IsTrue(schemas[-1].IsCompletedSuccessfully);
- Assert.IsTrue(schemas[1].IsCompletedSuccessfully);
+
+ Assert.IsTrue(schemas[-1].IsCompletedSuccessfully,
"schemas[-1].IsCompletedSuccessfully");
+ Assert.IsTrue(schemas[1].IsCompletedSuccessfully,
"schemas[1].IsCompletedSuccessfully");
+
+ Assert.IsTrue(firstOpFailed, "firstOpFailed");
}
}
diff --git
a/modules/platforms/dotnet/Apache.Ignite/Internal/ClientFailoverSocket.cs
b/modules/platforms/dotnet/Apache.Ignite/Internal/ClientFailoverSocket.cs
index cf217b6f86d..8ab08f38c6d 100644
--- a/modules/platforms/dotnet/Apache.Ignite/Internal/ClientFailoverSocket.cs
+++ b/modules/platforms/dotnet/Apache.Ignite/Internal/ClientFailoverSocket.cs
@@ -418,6 +418,12 @@ namespace Apache.Ignite.Internal
Justification = "Secondary connection errors can be ignored.")]
private async Task ConnectAllSockets()
{
+ if (_endpoints.Count == 1)
+ {
+ // No secondary connections to establish.
+ return;
+ }
+
while (!_disposed)
{
if (_logger.IsEnabled(LogLevel.Debug))
diff --git a/modules/platforms/dotnet/Apache.Ignite/Internal/LogMessages.cs
b/modules/platforms/dotnet/Apache.Ignite/Internal/LogMessages.cs
index b7ae54403f7..a3f913f9e8a 100644
--- a/modules/platforms/dotnet/Apache.Ignite/Internal/LogMessages.cs
+++ b/modules/platforms/dotnet/Apache.Ignite/Internal/LogMessages.cs
@@ -219,4 +219,11 @@ internal static partial class LogMessages
EventId = 1029)]
internal static partial void LogServerOpTrace(
this ILogger logger, long requestId, int op, ServerOp opType, EndPoint
remoteAddress);
+
+ [LoggerMessage(
+ Message = "Table op failed [op={Op}]",
+ Level = LogLevel.Debug,
+ EventId = 1030)]
+ internal static partial void LogFailedTableOpDebug(
+ this ILogger logger, Exception e, ClientOp op);
}
diff --git
a/modules/platforms/dotnet/Apache.Ignite/Internal/Table/RecordView.cs
b/modules/platforms/dotnet/Apache.Ignite/Internal/Table/RecordView.cs
index fbc5efa279c..19679789091 100644
--- a/modules/platforms/dotnet/Apache.Ignite/Internal/Table/RecordView.cs
+++ b/modules/platforms/dotnet/Apache.Ignite/Internal/Table/RecordView.cs
@@ -561,6 +561,12 @@ namespace Apache.Ignite.Internal.Table
schemaVersionOverride = Table.SchemaVersionForceLatest;
return await DoRecordOutOpAsync(op, transaction, record,
keyOnly, schemaVersionOverride).ConfigureAwait(false);
}
+ catch (Exception e)
+ {
+ _logger.LogFailedTableOpDebug(e, op);
+
+ throw;
+ }
}
[SuppressMessage("Maintainability", "CA1508:Avoid dead conditional
code", Justification = "False positive.")]