Skip to content

Commit 078117d

Browse files
authored
Merge branch 'ydb-platform:main' into main
2 parents 25ead1f + b1e141e commit 078117d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+2265
-296
lines changed

.github/workflows/slo-topic.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: SLO YDB Topics
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
schedule:
9+
- cron: "45 * * * *"
10+
jobs:
11+
ydb-slo-topic-action:
12+
name: SLO Topic test
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
- name: Install .NET
19+
uses: actions/setup-dotnet@v4
20+
with:
21+
dotnet-version: 8.0.x
22+
- name: Set up Docker Compose
23+
uses: hoverkraft-tech/[email protected]
24+
with:
25+
compose-file: "./slo/playground/configs/compose.yaml"
26+
- name: Prepare SLO Database
27+
run: |
28+
cd slo/src/TopicService
29+
dotnet run create grpc://localhost:2135 /Root/testdb
30+
- name: Run SLO Tests
31+
run: |
32+
cd slo/src/TopicService
33+
dotnet run run grpc://localhost:2135 /Root/testdb \
34+
--write-rps 50 \
35+
--time 600

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ jobs:
110110
run: |
111111
docker cp ydb-local:/ydb_certs/ca.pem ~/
112112
cd src
113-
dotnet test --filter "FullyQualifiedName~Topic" -f ${{ matrix.dotnet-target-framework }} -l "console;verbosity=normal"
113+
dotnet test --filter "FullyQualifiedName~Topic" -f ${{ matrix.dotnet-target-framework }} -l "console;verbosity=detailed"
114114
integration-tests:
115115
runs-on: ubuntu-22.04
116116
strategy:

CHANGELOG.md

Lines changed: 118 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,70 @@
1-
* Fixed: YdbDataReader.GetDataTypeName for optional values.
2-
* Added support for "Columns" collectionName in YdbConnection.GetSchema(Async).
1+
## v0.14.1
2+
- Fixed bug: public key presented not for certificate signature.
3+
- Fixed: YdbDataReader does not throw YdbException when CloseAsync is called for UPDATE/INSERT statements with no
4+
result.
5+
6+
## v0.14.0
7+
8+
- Reader client for YDB topics
9+
- Fixed: send PartitionIds in InitRequest.
10+
- Do a committed offset on StopPartitionSessionRequest event anyway.
11+
- Added log info on StopPartitionSessionRequest event.
12+
- PartitioningSettings were changed to change the PartitionCountLimit to MaxActivePartitions.
13+
- Dev: updated System.IdentityModel.Tokens.Jwt from version 0.7.0 to version 8.5.0.
14+
- PartitionSession.Stop uses committedOffset to complete commit tasks.
15+
- Changed batch type: IReadOnlyCollection<Message<TValue>> -> IReadOnlyList<Message<TValue>>.
16+
- Invoking TryReadRequestBytes before deserializing message.
17+
- Updated Ydb.Protos 1.0.6 -> 1.1.1: Updated version of the Grpc.Net.Client library to 2.67.0 and proto messages.
18+
- Fixed: YdbDataReader.GetDataTypeName for optional values.
19+
- Added support for "Columns" collectionName in YdbConnection.GetSchema(Async).
320

421
## v0.12.0
5-
* GetUint64(int ordinal) returns a ulong for Uint8, Uint16, Uint32, Uint64 YDB types.
6-
* GetInt64(int ordinal) returns a int for Int8, Int16, Int32, Int64, Uint8, Uint16, Uint32 YDB types.
7-
* GetUint32(int ordinal) returns a uint for Uint8, Uint16, Uint32 YDB types.
8-
* GetInt32(int ordinal) returns a int for Int8, Int16, Int32, Uint8, Uint16 YDB types.
9-
* GetUint16(int ordinal) returns a ushort for Uint8, Uint16 YDB types.
10-
* GetInt16(int ordinal) returns a short for Int8, Int16, Uint8 YDB types.
11-
* GetDouble(int ordinal) returns a double for Float and Double YDB types.
12-
* Throw InvalidCastException on string.Empty in `GetChar(int ordinal)`.
13-
* Changed Ydb.Sdk.Value.InvalidTypeException to InvalidCastException in YdbValueParser.
14-
* Changed InvalidCastException to InvalidOperationException in YdbParameter.
15-
* Added specification tests: YdbCommandTests and YdbParameterTests.
16-
* YdbConnection.Database returns string.Empty if ConnectionStringBuilder is null.
17-
* Propagated cancellationToken in Execute[.*]Async methods.
18-
* When YdbCommand has an open data reader, it throws InvalidOperationException on the setters: CommandText, DbConnection.
19-
* Added checkers to YdbCommand.Prepare().
20-
* CommandText getter doesn't throw an exception if the CommandText property has not been initialized.
22+
23+
- GetUint64(int ordinal) returns a ulong for Uint8, Uint16, Uint32, Uint64 YDB types.
24+
- GetInt64(int ordinal) returns a int for Int8, Int16, Int32, Int64, Uint8, Uint16, Uint32 YDB types.
25+
- GetUint32(int ordinal) returns a uint for Uint8, Uint16, Uint32 YDB types.
26+
- GetInt32(int ordinal) returns a int for Int8, Int16, Int32, Uint8, Uint16 YDB types.
27+
- GetUint16(int ordinal) returns a ushort for Uint8, Uint16 YDB types.
28+
- GetInt16(int ordinal) returns a short for Int8, Int16, Uint8 YDB types.
29+
- GetDouble(int ordinal) returns a double for Float and Double YDB types.
30+
- Throw InvalidCastException on string.Empty in `GetChar(int ordinal)`.
31+
- Changed Ydb.Sdk.Value.InvalidTypeException to InvalidCastException in YdbValueParser.
32+
- Changed InvalidCastException to InvalidOperationException in YdbParameter.
33+
- Added specification tests: YdbCommandTests and YdbParameterTests.
34+
- YdbConnection.Database returns string.Empty if ConnectionStringBuilder is null.
35+
- Propagated cancellationToken in Execute[.*]Async methods.
36+
- When YdbCommand has an open data reader, it throws InvalidOperationException on the setters: CommandText,
37+
DbConnection.
38+
- Added checkers to YdbCommand.Prepare().
39+
- CommandText getter doesn't throw an exception if the CommandText property has not been initialized.
2140

2241
## v0.11.0
23-
* Fix bug: GetValue(int ordinal) return DBNull.Value if fetched NULL value.
24-
* Fix: NextResult() moves to the next result and skip the first ResultSet.
25-
* Added specification DbDataReaderTests.
26-
* If dataOffset is larger than the length of data, GetChars and GetBytes methods will return 0.
27-
* If YdbDataReader is closed: `throw new InvalidOperationException("The reader is closed")`.
28-
* InvalidOperationException on ConnectionString property has not been initialized.
29-
* One YdbTransaction per YdbConnection. Otherwise, throw an exception: InvalidOperationException("A transaction is already in progress; nested/concurrent transactions aren't supported.").
30-
* ConnectionString returns an empty.String when it is not set.
31-
* When a YdbDataReader is closed, if stream is not empty, a YdbTransaction fails if it is not null. A session also fails due to a possible error SessionBusy race condition with the server.
32-
* Fixed bug: Fetch txId from the last result set.
33-
* YdbTransaction CheckDisposed() (invoke rollback if transaction hasn't been committed).
34-
* Dev: Added specification tests for YdbTransaction.
42+
43+
- Fix bug: GetValue(int ordinal) return DBNull.Value if fetched NULL value.
44+
- Fix: NextResult() moves to the next result and skip the first ResultSet.
45+
- Added specification DbDataReaderTests.
46+
- If dataOffset is larger than the length of data, GetChars and GetBytes methods will return 0.
47+
- If YdbDataReader is closed: `throw new InvalidOperationException("The reader is closed")`.
48+
- InvalidOperationException on ConnectionString property has not been initialized.
49+
- One YdbTransaction per YdbConnection. Otherwise, throw an exception: InvalidOperationException("A transaction is
50+
already in progress; nested/concurrent transactions aren't supported.").
51+
- ConnectionString returns an empty.String when it is not set.
52+
- When a YdbDataReader is closed, if stream is not empty, a YdbTransaction fails if it is not null. A session also fails
53+
due to a possible error SessionBusy race condition with the server.
54+
- Fixed bug: Fetch txId from the last result set.
55+
- YdbTransaction CheckDisposed() (invoke rollback if transaction hasn't been committed).
56+
- Dev: Added specification tests for YdbTransaction.
3557

3658
## v0.10.0
37-
- Fixed bug in Topic Writer: race condition when session fails, then write operation starts on previous session and new session is created. Messages may be lost.
38-
- Supported in ADO.NET GetSchema(Async). CollectionNames:
39-
* Tables
40-
* TablesWithCollections
41-
* DataSourceInformation
42-
* MetaDataCollections
43-
* Restrictions
59+
60+
- Fixed bug in Topic Writer: race condition when session fails, then write operation starts on previous session and new
61+
session is created. Messages may be lost.
62+
- Supported in ADO.NET GetSchema(Async). CollectionNames:
63+
* Tables
64+
* TablesWithCollections
65+
* DataSourceInformation
66+
* MetaDataCollections
67+
* Restrictions
4468
- Rename field _onStatus -> _onNotSuccessStatus in YdbDataReader
4569
- If session is not active, do not invoke DeleteNotActiveSession(session)
4670
- AttachStream: connect stream using NodeId
@@ -49,6 +73,7 @@
4973
- DbConnection.Session.OnStatus(status) in YdbTransaction
5074

5175
## v0.9.4
76+
5277
- Do not pessimize the node on Grpc.Core.StatusCode.Cancelled and Grpc.Core.StatusCode.DeadlineExceeded.
5378
- Dispose of WriterSession using dispose CancellationToken.
5479
- BidirectionalStream is internal class.
@@ -57,124 +82,159 @@
5782
- Cancel writing tasks after disposing of Writer.
5883

5984
## v0.9.3
85+
6086
- Fixed bug in Topic Writer: worker is stopped by disposeCts
61-
- Fixed bug in sql parser ADO.NET: deduplication declare param in YQL query
87+
- Fixed bug in sql parser ADO.NET: deduplication declare param in YQL query
6288
- Deleted property BufferOverflowRetryTimeoutMs
6389

6490
## v0.9.2
91+
6592
- Fixed bug: delete deadline grpc timeout on AttachStream
6693

6794
## v0.9.1
95+
6896
- Update log level on AttachStream
6997

7098
## v0.9.0
99+
71100
- Writer client for YDB topics
72-
- Fixed bug: delete default timeout grpc.deadline
101+
- Fixed bug: delete default timeout grpc.deadline
73102

74103
## v0.9.0-rc1
104+
75105
- Topic Writer updated release candidate:
76-
* Do not send messages that have a timeout by cancelToken.
77-
* If your value serializer throws an exception, this will be wrapped in a WriterException with unspecified status.
78-
* Added BufferOverflowRetryTimeoutMs to the next try write.
79-
* Rename _disposeTokenSource -> _disposeCts.
80-
* Optimize write worker: if (_toSendBuffer.IsEmpty) continue.
81-
* On RPC errors create DummyWriterSession.
82-
* Message has been skipped because its sequence number is less than or equal to the last processed server's SeqNo.
83-
* Calculate the next sequence number from the calculated previous messages.
106+
* Do not send messages that have a timeout by cancelToken.
107+
* If your value serializer throws an exception, this will be wrapped in a WriterException with unspecified status.
108+
* Added BufferOverflowRetryTimeoutMs to the next try write.
109+
* Rename _disposeTokenSource -> _disposeCts.
110+
* Optimize write worker: if (_toSendBuffer.IsEmpty) continue.
111+
* On RPC errors create DummyWriterSession.
112+
* Message has been skipped because its sequence number is less than or equal to the last processed server's SeqNo.
113+
* Calculate the next sequence number from the calculated previous messages.
84114

85115
## v0.9.0-rc0
116+
86117
- Topic Writer release candidate:
87-
* Updated CAS semantics for enqueuing in the buffer.
88-
* Processed buffer overflow on WriteAsync.
89-
* Setting NotStartedWriterSession with a fail reason on RPC and more errors.
90-
* New initialization strategy for WriterSession (background task).
91-
* Supported cancellation token for sending tasks.
92-
* Fixed setting the SeqNo field in the message (in-flight buffer already has a seqNo) and added a check on canceled TCS.
93-
* Using BitConverter for Serializer / Deserializer.
94-
- Fixed: grpc requests go via proxy on Grpc.NET.Client >= 2.44
118+
* Updated CAS semantics for enqueuing in the buffer.
119+
* Processed buffer overflow on WriteAsync.
120+
* Setting NotStartedWriterSession with a fail reason on RPC and more errors.
121+
* New initialization strategy for WriterSession (background task).
122+
* Supported cancellation token for sending tasks.
123+
* Fixed setting the SeqNo field in the message (in-flight buffer already has a seqNo) and added a check on canceled
124+
TCS.
125+
* Using BitConverter for Serializer / Deserializer.
126+
- Fixed: grpc requests go via proxy on Grpc.NET.Client >= 2.44
95127

96128
## v0.8.0
97-
- Fixed bug on commit with fail, no set failed flag for rollback invocation
129+
130+
- Fixed bug on commit with fail, no set failed flag for rollback invocation
98131
- Supported UUID (Guid)
99132

100133
## v0.7.3
134+
101135
- Fixed YdbDataReader: extract Json / Yson types
102136

103137
## v0.7.2
138+
104139
- Fixed YdbDataReader: `GetValue()` returns `DbNull.Value` if field is null
105140
- YdbOperationInProgressException extends YdbException
106141

107142
## v0.7.1
143+
108144
- If an error happened in the transaction, allow one empty rollback
109145

110146
## v0.7.0
147+
111148
- Parsed @param then prepared for use with $ prefix (@p -> $p)
112149
- Fully integrated with Dapper
113150

114151
## v0.6.3
152+
115153
- Fixed bug: parameter type mismatch, when setting optional with null
116154

117155
## v0.6.2
156+
118157
- Fixed bug: adding correct placeholders to all logging calls with parameters
119158

120159
## v0.6.1
160+
121161
- Check status of the transport or server for an invalidated session
122162
- Fixed NPE in DescribeTable
123163

124164
## v0.6.0
165+
125166
- ADO.NET over query-service
126167
- Add EndpointPool
127168
- Add SessionPool 2.0
128169

129170
## v0.4.0
171+
130172
- Fix bug: rounding down when inserting a Timestamp YDB type
131173
- ChannelCache has been implemented using ChannelPool and EndpointPool
132174

133175
## v0.3.2
176+
134177
- Make KeepAlive method public for TableClient
135178

136179
## v0.3.1
180+
137181
- Fix error: Access denied without user token
138182

139183
## v0.3.0
184+
140185
- Add rollback transaction API
141186

142187
## v0.2.2
188+
143189
- Passed logger to TxControl.ToProto
144190

145191
## v0.2.1
192+
146193
- Retry discovery on driver initialize
147194

148195
## v0.2.0
196+
149197
- Added MakeTablePath, CopyTable, CopyTables, DescribeTable methods for TableClient
150198
- Add logging for transactions
151199

152200
## v0.1.5
201+
153202
- Fix timeout error on create session
154203
- Fix transport error on delete session
155204

156205
## v0.1.4
206+
157207
- Add exception throwing when results truncated
158208
- lint: add line feed at file end
159209

160210
## v0.1.3
211+
161212
- Add static auth
213+
162214
## v0.1.1
215+
163216
- Add static code analysis
164217
- Add CodeQL analysis
165218
- Add linter
166219
- Apply uniform code style and fix all warnings
220+
167221
## v0.1.0
222+
168223
- Add support of decimal type
224+
169225
## v0.0.9
226+
170227
- Remove support for .NET Core 3.1
171228
- Add support for .NET 7.0
172-
-
229+
-
230+
173231
## v0.0.8
232+
174233
- Fixed version number
175234

176235
## v0.0.6
177-
- Add methods for castion to c# nullable to YQL Optional
236+
237+
- Add methods for castion to c# nullable to YQL Optional
178238
- Add explicit cast operator for some types
179239
- Tests refactoring
180240
- Add Bool type support

examples/src/YC/CmdOptions.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using CommandLine;
2+
3+
namespace YcCloud;
4+
5+
internal class CmdOptions
6+
{
7+
[Option('h', "host", Required = true, HelpText = "Database host")]
8+
public string Host { get; set; } = null!;
9+
10+
[Option('d', "database", Required = true, HelpText = "Database name")]
11+
public string Database { get; set; } = null!;
12+
13+
[Option("saFilePath", Required = true, HelpText = "Sa Key")]
14+
public string SaFilePath { get; set; } = null!;
15+
}

examples/src/YC/Program.cs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using CommandLine;
2+
using Microsoft.Extensions.Logging;
3+
using YcCloud;
4+
using Ydb.Sdk.Ado;
5+
using Ydb.Sdk.Yc;
6+
7+
await Parser.Default.ParseArguments<CmdOptions>(args).WithParsedAsync(async cmd =>
8+
{
9+
var loggerFactory = LoggerFactory.Create(builder => builder.AddConsole().SetMinimumLevel(LogLevel.Information));
10+
11+
var saProvider = new ServiceAccountProvider(saFilePath: cmd.SaFilePath, loggerFactory: loggerFactory);
12+
await saProvider.Initialize();
13+
14+
var builder = new YdbConnectionStringBuilder
15+
{
16+
UseTls = true,
17+
Host = cmd.Host,
18+
Port = 2135,
19+
Database = cmd.Database,
20+
CredentialsProvider = saProvider,
21+
LoggerFactory = loggerFactory,
22+
ServerCertificates = YcCerts.GetYcServerCertificates()
23+
};
24+
25+
await using var ydbConnection = new YdbConnection(builder);
26+
await ydbConnection.OpenAsync();
27+
28+
Console.WriteLine(await new YdbCommand(ydbConnection) { CommandText = "SELECT 'Hello Dedicated YDB!'u" }
29+
.ExecuteScalarAsync());
30+
});

0 commit comments

Comments
 (0)