diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryStructureTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryStructureTest.cs
index 1bd2bf400f..70fb63ae10 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryStructureTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryStructureTest.cs
@@ -146,6 +146,23 @@ namespace Apache.Ignite.Core.Tests.Binary
Assert.AreEqual(3, res.Nested.Baz);
Assert.AreEqual(5, res.Nested.Qux);
}
+
+ ///
+ /// Runs write/read test in multiple threads, using random field order to create lots of schemas.
+ ///
+ [Test]
+ public void TestRandomOrderFields()
+ {
+ var marsh = new Marshaller(new BinaryConfiguration(typeof(RandomFieldOrder)));
+ var obj = new RandomFieldOrder();
+
+ for (var i = 0; i < 100; i++)
+ {
+ var bytes = marsh.Marshal(obj);
+
+ marsh.Unmarshal(bytes);
+ }
+ }
}
[SuppressMessage("ReSharper", "InconsistentNaming")]
@@ -385,4 +402,36 @@ namespace Apache.Ignite.Core.Tests.Binary
Baz = reader.ReadInt("baz");
}
}
+
+ public class RandomFieldOrder : IBinarizable
+ {
+ public const int FieldCount = 50;
+
+ public void WriteBinary(IBinaryWriter writer)
+ {
+ foreach (var fieldName in GetRandomOrderFieldNames())
+ {
+ writer.WriteString(fieldName, fieldName);
+ }
+ }
+
+ public void ReadBinary(IBinaryReader reader)
+ {
+ foreach (var fieldName in GetRandomOrderFieldNames())
+ {
+ var fieldValue = reader.ReadString(fieldName);
+
+ if (fieldValue != null)
+ {
+ Assert.AreEqual(fieldName, fieldValue);
+ }
+ }
+ }
+
+ private static IEnumerable GetRandomOrderFieldNames()
+ {
+ return Enumerable.Range(0, FieldCount).Select(x => "Field_" + x).OrderBy(_ => Guid.NewGuid())
+ .Skip(IgniteUtils.ThreadLocalRandom.Next(FieldCount));
+ }
+ }
}
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Structure/BinaryStructure.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Structure/BinaryStructure.cs
index 908059abdc..c590fa3188 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Structure/BinaryStructure.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Structure/BinaryStructure.cs
@@ -94,6 +94,9 @@ namespace Apache.Ignite.Core.Impl.Binary.Structure
BinaryStructureJumpTable jmpTbl = _jumps[entry.Id];
+ if (jmpTbl == null)
+ return 0;
+
int pathIdx0 = jmpTbl.GetPathIndex(fieldName);
if (pathIdx0 < 0)