Skip to content

Commit 29de4e5

Browse files
fix
1 parent 6706b1c commit 29de4e5

File tree

7 files changed

+43
-25
lines changed

7 files changed

+43
-25
lines changed

.github/workflows/slo.yml

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,6 @@ on:
77
pull_request:
88
branches:
99
- main
10-
workflow_dispatch:
11-
inputs:
12-
github_pull_request_number:
13-
required: true
14-
slo_workload_duration_seconds:
15-
default: '600'
16-
required: false
17-
slo_workload_read_max_rps:
18-
default: '1000'
19-
required: false
20-
slo_workload_write_max_rps:
21-
default: '1000'
22-
required: false
2310

2411
jobs:
2512
ydb-slo-action:
@@ -33,6 +20,16 @@ jobs:
3320
- AdoNet
3421
- Dapper
3522
- EF
23+
include:
24+
- workload: AdoNet
25+
read_rps: 1000
26+
write_rps: 1000
27+
- workload: Dapper
28+
read_rps: 1000
29+
write_rps: 1000
30+
- workload: EF
31+
read_rps: 200
32+
write_rps: 200
3633

3734
concurrency:
3835
group: slo-${{ github.ref }}-${{ matrix.workload }}
@@ -66,9 +63,9 @@ jobs:
6663
dotnet run run "Host=localhost;Port=2135;Database=/Root/testdb" \
6764
--prom-pgw http://localhost:9091 \
6865
--report-period 250 \
69-
--time ${{inputs.slo_workload_duration_seconds || 600 }} \
70-
--read-rps ${{inputs.slo_workload_read_max_rps || 1000 }} \
71-
--write-rps ${{inputs.slo_workload_write_max_rps || 1000 }} \
66+
--time 600 \
67+
--read-rps ${{matrix.read_rps || 1000 }} \
68+
--write-rps ${{matrix.write_rps || 1000 }} \
7269
--read-timeout 1000 \
7370
--write-timeout 1000
7471

src/EFCore.Ydb/src/Storage/Internal/Mapping/YdbDecimalTypeMapping.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System;
21
using Microsoft.EntityFrameworkCore.Storage;
32

43
namespace EntityFrameworkCore.Ydb.Storage.Internal.Mapping;
@@ -8,9 +7,11 @@ public class YdbDecimalTypeMapping : DecimalTypeMapping
87
private const byte DefaultPrecision = 22;
98
private const byte DefaultScale = 9;
109

11-
public YdbDecimalTypeMapping(Type? type) : this(
10+
public new static YdbDecimalTypeMapping Default => new();
11+
12+
public YdbDecimalTypeMapping() : this(
1213
new RelationalTypeMappingParameters(
13-
new CoreTypeMappingParameters(type ?? typeof(decimal)),
14+
new CoreTypeMappingParameters(typeof(decimal)),
1415
storeType: "Decimal",
1516
dbType: System.Data.DbType.Decimal
1617
)
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using Microsoft.EntityFrameworkCore.Storage;
2+
3+
namespace EntityFrameworkCore.Ydb.Storage.Internal.Mapping;
4+
5+
public class YdbGuidTypeMapping : GuidTypeMapping
6+
{
7+
public new static YdbGuidTypeMapping Default => new();
8+
9+
private YdbGuidTypeMapping() : base("Uuid", System.Data.DbType.Guid)
10+
{
11+
}
12+
13+
protected YdbGuidTypeMapping(RelationalTypeMappingParameters parameters) : base(parameters)
14+
{
15+
}
16+
17+
protected override RelationalTypeMapping Clone(RelationalTypeMappingParameters parameters) =>
18+
new YdbGuidTypeMapping(parameters);
19+
20+
protected override string SqlLiteralFormatString => "Uuid('{0}')";
21+
}

src/EFCore.Ydb/src/Storage/Internal/YdbExecutionStrategy.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ public class YdbExecutionStrategy(ExecutionStrategyDependencies dependencies)
88
: ExecutionStrategy(dependencies, maxRetryCount: 10, maxRetryDelay: TimeSpan.FromSeconds(10)) // TODO User settings
99
{
1010
protected override bool ShouldRetryOn(Exception exception)
11-
=> exception is YdbException { IsTransientWhenIdempotent: true };
11+
=> exception is YdbException { IsTransient: true };
1212
}

src/EFCore.Ydb/src/Storage/Internal/YdbTypeMappingSource.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ RelationalTypeMappingSourceDependencies relationalDependencies
3030
private static readonly FloatTypeMapping Float = new("Float", DbType.Single);
3131
private static readonly DoubleTypeMapping Double = new("Double", DbType.Double);
3232

33-
private static readonly YdbDecimalTypeMapping Decimal = new(typeof(decimal));
33+
private static readonly YdbDecimalTypeMapping Decimal = YdbDecimalTypeMapping.Default;
3434

35-
private static readonly GuidTypeMapping Guid = new("Uuid");
35+
private static readonly GuidTypeMapping Guid = YdbGuidTypeMapping.Default;
3636

3737
private static readonly YdbTextTypeMapping Text = YdbTextTypeMapping.Default;
3838
private static readonly YdbBytesTypeMapping Bytes = YdbBytesTypeMapping.Default;

src/Ydb.Sdk/tests/Topic/ReaderUnitTests.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,9 +1091,8 @@ public async Task
10911091
_mockStream.Verify(stream => stream.Current, Times.Exactly(7));
10921092

10931093
_mockStream.Verify(stream => stream.Write(It.Is<FromClient>(msg =>
1094-
msg.InitRequest != null &&
1095-
msg.InitRequest.Consumer == "Consumer" &&
1096-
msg.InitRequest.TopicsReadSettings[0].Path == "/topic")), Times.Exactly(2));
1094+
msg.InitRequest != null && msg.InitRequest.Consumer == "Consumer" &&
1095+
msg.InitRequest.TopicsReadSettings[0].Path == "/topic")), Times.Between(2, 3, Range.Inclusive));
10971096
_mockStream.Verify(stream => stream.Write(It.Is<FromClient>(msg =>
10981097
msg.ReadRequest != null && msg.ReadRequest.BytesSize == 100)), Times.Exactly(2));
10991098
_mockStream.Verify(stream => stream.Write(It.Is<FromClient>(msg =>

0 commit comments

Comments
 (0)