Skip to content

Comments

fix: warn on invalid protobuf TxnOp and unknown ConditionResult#70

Merged
drmingdrmer merged 1 commit intodatabendlabs:mainfrom
drmingdrmer:035-txnop-none-error
Feb 21, 2026
Merged

fix: warn on invalid protobuf TxnOp and unknown ConditionResult#70
drmingdrmer merged 1 commit intodatabendlabs:mainfrom
drmingdrmer:035-txnop-none-error

Conversation

@drmingdrmer
Copy link
Member

Changelog

fix: warn on invalid protobuf TxnOp and unknown ConditionResult

Two silent-fallback behaviors in protobuf-to-native conversion are now
logged:

  • TxnOp with request: None silently becomes Operation::get("").
    This masks protocol errors and can produce unexpected data reads.
    A warning is now emitted so the issue is observable in logs.

  • Unknown ConditionResult value (out-of-range i32) silently becomes
    CompareOperator::Eq, which changes the intended condition semantics.
    A warning is now emitted for this case as well.

Both keep the existing fallback behavior for backward compatibility with
persisted raft log entries, but make the anomalies visible to operators.


  • Bug Fix

Two silent-fallback behaviors in protobuf-to-native conversion are now
logged:

- `TxnOp` with `request: None` silently becomes `Operation::get("")`.
  This masks protocol errors and can produce unexpected data reads.
  A warning is now emitted so the issue is observable in logs.

- Unknown `ConditionResult` value (out-of-range i32) silently becomes
  `CompareOperator::Eq`, which changes the intended condition semantics.
  A warning is now emitted for this case as well.

Both keep the existing fallback behavior for backward compatibility with
persisted raft log entries, but make the anomalies visible to operators.
Copilot AI review requested due to automatic review settings February 21, 2026 08:09
Copy link
Collaborator

@xp-trumpet xp-trumpet left a comment

Choose a reason for hiding this comment

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

@xp-trumpet reviewed 1 file and all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on drmingdrmer).

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves observability in protobuf-to-native conversion by adding warning logs for two silent fallback scenarios. When invalid or missing protobuf data is encountered during deserialization, the system now emits warnings while maintaining backward compatibility with existing raft log entries.

Changes:

  • Added warning log when TxnOp has no request field and silently falls back to Operation::get("")
  • Added warning log when ConditionResult has an unknown/out-of-range value and falls back to CompareOperator::Eq

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@drmingdrmer drmingdrmer added this pull request to the merge queue Feb 21, 2026
Merged via the queue into databendlabs:main with commit 413c391 Feb 21, 2026
7 checks passed
@drmingdrmer drmingdrmer deleted the 035-txnop-none-error branch February 21, 2026 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants