Skip to content

Conversation

@kprokopenko
Copy link
Collaborator

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Other information

@github-actions
Copy link

github-actions bot commented Dec 2, 2025

summary

Inferred base version: v3.121.0
Suggested version: v3.121.1

@codecov-commenter
Copy link

codecov-commenter commented Dec 3, 2025

Codecov Report

❌ Patch coverage is 87.20000% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.82%. Comparing base (65ead76) to head (e9d74ec).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
...rnal/topic/topicreaderinternal/batch_tx_storage.go 87.36% 7 Missing and 5 partials ⚠️
...al/topic/topicreaderinternal/stream_reader_impl.go 86.66% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1968      +/-   ##
==========================================
- Coverage   73.97%   73.82%   -0.16%     
==========================================
  Files         394      395       +1     
  Lines       34454    34555     +101     
==========================================
+ Hits        25489    25510      +21     
- Misses       7842     7910      +68     
- Partials     1123     1135      +12     
Flag Coverage Δ
experiment 73.17% <80.80%> (-0.47%) ⬇️
go-1.21.x 72.64% <87.20%> (-0.08%) ⬇️
go-1.25.x 73.80% <87.20%> (-0.17%) ⬇️
integration 54.93% <84.00%> (-0.30%) ⬇️
macOS 47.35% <85.60%> (+0.04%) ⬆️
ubuntu 73.82% <87.20%> (-0.16%) ⬇️
unit 47.36% <85.60%> (+0.03%) ⬆️
windows 47.34% <85.60%> (+0.04%) ⬆️
ydb-24.4 54.17% <84.00%> (-0.04%) ⬇️
ydb-25.2 54.85% <84.00%> (-0.04%) ⬇️
ydb-latest 54.49% <84.00%> (-0.34%) ⬇️
ydb-nightly 73.17% <80.80%> (-0.47%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kprokopenko kprokopenko marked this pull request as ready for review December 8, 2025 10:42
@kprokopenko kprokopenko added the SLO label Dec 8, 2025
@kprokopenko kprokopenko requested a review from rekby December 8, 2025 12:52
@github-actions
Copy link

github-actions bot commented Dec 8, 2025

🌋 SLO Test Results

Status: 🟡 6 workloads tested • 3 workloads with warnings

Workload Metrics Regressions Improvements Links
🟢 native-table-over-query-service 8 1 0 ReportCheck
🟢 native-query 8 0 0 ReportCheck
🟡 native-bulk-upsert 8 0 0 ReportCheck
🟡 database-sql-table 8 0 0 ReportCheck
🟢 native-table 8 0 0 ReportCheck
🟡 database-sql-query 8 0 0 ReportCheck

Generated by ydb-slo-action

@github-actions github-actions bot removed the SLO label Dec 8, 2025

req := r.createUpdateOffsetRequest(ctx, batch, tx)
updateOffsetInTransactionErr := retry.Retry(ctx, func(ctx context.Context) (err error) {
if r.batchTxStorage.Add(tx, batch) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

непонятное для чтения


tx.OnBeforeCommit(r.txBeforeCommitFn(tx))

tx.OnCompleted(func(err error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Получится тоже вынести в отдельный метод?

po := &partitionOffsets[i]
info, ok := sessionInfoMap[po.PartitionSessionID]
if !ok {
// Skip if session info not found (should not happen in normal flow)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вот тут тогда надо кидать ошибку, чтобы не скрывать внутренние ошибки если они появятся.

пропущенный коммит отлаживать будет заметно сложнее, чем явную ошибку.

)

type BatchTxStorageTestSuite struct {
suite.Suite
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужны ли тут suite? этот способ запуска тестов новый для go sdk

… testify suite with require, streamline test functions, and enhance helper methods for better readability and maintainability.
// GetOrCreateTransactionBatches gets or creates a transaction batches handler for the given transaction.
// It returns the handler and a flag indicating whether the transaction is new (true) or already existed (false).
// This method is thread-safe.
func (s *batchTxStorage) GetOrCreateTransactionBatches(transaction tx.Transaction) (*transactionBatches, bool) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут я бы использовал именованные результаты - чтобы было понятно что означает bool без чтения длинного комментария, как в
https://pkg.go.dev/sync@go1.25.5#Map.LoadAndDelete

s.m.Unlock()

if !ok {
return nil, errNoBatches
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тут заворачивал бы ошибки в WithTrace - чтобы видеть где конкретно она возникла, когда одна и та же ошибка может кидаться в разных местах кода.

po := &partitionOffsets[i]
info, ok := sessionInfoMap[po.PartitionSessionID]
if !ok {
return nil, fmt.Errorf("session info not found for partition session ID %d", po.PartitionSessionID)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

и тут тоже withtrace, да и вообще - везде

…s with stack traces and improve return values for transaction batch creation.
…or improved readability by formatting function parameters and error messages across multiple lines.
@kprokopenko kprokopenko merged commit 8433105 into master Dec 11, 2025
55 of 59 checks passed
@kprokopenko kprokopenko deleted the update_offsets_bugfix branch December 11, 2025 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants