Skip to content

Conversation

@kim
Copy link
Contributor

@kim kim commented Apr 12, 2024

Fix a minor bug where completely empty transactions would still be
written to the commitlog. The bug is minor because, once we start
logging inputs, all transactions will be non-empty.

The check is done in relational DB rather than the durability crate,
because in principle empty transactions are permissible, and may be used
in the future (e.g. to confirm a certain offset).

Expected complexity level and risk

1

Testing

Describe any testing you've done, and any testing you'd like your reviewers to do,
so that you're confident that all the changes work as expected!

  • Test suite passes
  • Log output is absent as expected when calling a reducer which doesn't
    modify rows (where previously it was present).

Fix a minor bug where completely empty transactions would still be
written to the commitlog. The bug is minor because, once we start
logging inputs, all transactions will be non-empty.

The check is done in relational DB rather than the durability crate,
because in principle empty transactions are permissible, and may be used
in the future (e.g. to confirm a certain offset).
Copy link
Contributor

@kazimuth kazimuth left a comment

Choose a reason for hiding this comment

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

👍

@kim kim added this pull request to the merge queue Apr 12, 2024
log::trace!("append {txdata:?}");
// TODO: Should measure queuing time + actual write
durability.append_tx(txdata);

Copy link
Contributor

@cloutiertyler cloutiertyler Apr 12, 2024

Choose a reason for hiding this comment

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

Suggested change
// Fix a minor bug where completely empty transactions would still be
// written to the commitlog. The bug is minor because, once we start
// logging inputs, all transactions will be non-empty.
// The check is done in relational DB rather than the durability crate,
// because in principle empty transactions are permissible, and may be used
// in the future (e.g. to confirm a certain offset).

Copy link
Contributor

@cloutiertyler cloutiertyler left a comment

Choose a reason for hiding this comment

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

Approving with one suggestion to add the PR comment to the actual code.

Merged via the queue into master with commit 4cd17d7 Apr 12, 2024
@kim kim deleted the kim/fix/dont-persist-empty-txs branch April 15, 2024 07:57
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.

4 participants