Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v23.3.x] Wire transform::logging::manager into transform API, rpc client #16663

Merged

Conversation

oleiman
Copy link
Member

@oleiman oleiman commented Feb 21, 2024

Backport of PR #16485

Closes #16570
Closes #16572

rpc::create_transform_logs_topic
  - create model::transform_log_internal_topic
  - subject to existing rpc::client retry policy, 5x max, exponential backoff
    from 100ms
  - partition count reflects config::default_topic_partitions
  - batch_max_bytes reflects config::kafka_batch_max_bytes
  - topic cannot be produced to or deleted via Kafka API

Also adds condition to cluster::health_manager to bump topic replication
if node count increases from 1 to 3.

Signed-off-by: Oren Leiman <oren.leiman@redpanda.com>
(cherry picked from commit 9e357d1)
Previously model::transform_name. Building the iobuf here simplifies
downstream record batching logic slightly.

Signed-off-by: Oren Leiman <oren.leiman@redpanda.com>
(cherry picked from commit 6463799)
This way the new value gets picked up by the condition variable right away.

Signed-off-by: Oren Leiman <oren.leiman@redpanda.com>
(cherry picked from commit 91ce99e)
Signed-off-by: Oren Leiman <oren.leiman@redpanda.com>
(cherry picked from commit c41eaa1)
@oleiman oleiman added this to the v23.3.x-next milestone Feb 21, 2024
@oleiman oleiman added the kind/backport PRs targeting a stable branch label Feb 21, 2024
@oleiman oleiman self-assigned this Feb 21, 2024
@github-actions github-actions bot added area/redpanda area/wasm WASM Data Transforms labels Feb 21, 2024
To create the transform logs topic on demand. Also adds code in log_manager.cc
to perform this operation lazily at flush time.

Additionally, update logging::client to return transform::logging::errc
(or a result<> thereof). This becomes increasingly useful for error
reporting as we start hooking things up to the rest of the cluster.

Signed-off-by: Oren Leiman <oren.leiman@redpanda.com>
(cherry picked from commit d59c928)
A comment on model::packed_record_batch_header_size reflected a
presumably outdated value for the constant. Was 57, should be 61.

Replaces that comment with a static_assert to avoid similar errors
in future.

Signed-off-by: Oren Leiman <oren.leiman@redpanda.com>
(cherry picked from commit 5280839)
This is slightly easier to test and reason about, as well as being
nominally less costly in terms of buffer capacity.

Signed-off-by: Oren Leiman <oren.leiman@redpanda.com>
(cherry picked from commit f036951)
```
record(
      record_attributes attributes,
      int64_t timestamp_delta,
      int32_t offset_delta,
      iobuf key,
      iobuf value,
      std::vector<record_header> hdrs)
```

(cherry picked from commit a637233)
@oleiman oleiman force-pushed the vbotbuildovich/backport-16485-v23.3.x-310 branch from 06875e0 to d600c58 Compare February 21, 2024 19:58
@oleiman
Copy link
Member Author

oleiman commented Feb 21, 2024

/dt

Encapsulates a storage::record_batch_builder and aims to build up batches
of log records. Batches are kept under a specified maximum size to avoid
data loss. If appending a given kvp would cause a batch to exceed the
specified max, we roll to a new builder, appending the previous batch to
a running collection of completed, size-limited record_batches.

Includes a simple unit test for constructed record_batch sizes.

(cherry picked from commit ddea1e2)
Adapts transform::rpc::client for transform logging purposes.

Implements transform::logging::client.

Signed-off-by: Oren Leiman <oren.leiman@redpanda.com>
(cherry picked from commit 9562bbd)
Also Add sharded<metadata_cache> field to transform::service
in service of transform::logging::rpc_client.

Signed-off-by: Oren Leiman <oren.leiman@redpanda.com>
(cherry picked from commit 38f99f9)
Previously a static method on a SCRAM test.

Signed-off-by: Oren Leiman <oren.leiman@redpanda.com>
(cherry picked from commit ad2c4e6)
Includes a slightly modified identity transform that also logs the
incoming record to stderr.

Signed-off-by: Oren Leiman <oren.leiman@redpanda.com>
(cherry picked from commit a7f6ba0)
The previous handling was incorrect (awaiting on an invalid future),
this probably shouldn't fail silently, and everything in logging::manager::start
is noexcept anyway.

Signed-off-by: Oren Leiman <oren.leiman@redpanda.com>
(cherry picked from commit 84dac04)
@oleiman oleiman force-pushed the vbotbuildovich/backport-16485-v23.3.x-310 branch from d600c58 to 3b41a9d Compare February 21, 2024 21:46
@oleiman
Copy link
Member Author

oleiman commented Feb 21, 2024

force push headers 😐

@oleiman
Copy link
Member Author

oleiman commented Feb 21, 2024

/dt

@oleiman
Copy link
Member Author

oleiman commented Feb 22, 2024

CI Failures:

  • build TopicRecoveryTest.test_fast3
  • build AuditLogTestsAppLifecycle.test_drain_on_audit_disabled

@oleiman oleiman marked this pull request as ready for review February 22, 2024 04:55
@oleiman oleiman requested a review from a team as a code owner February 22, 2024 04:55
@oleiman oleiman requested review from savex and removed request for a team February 22, 2024 04:55
@oleiman
Copy link
Member Author

oleiman commented Feb 22, 2024

For anyone reviewing - cherry-picks two PRs (see description). Mostly clean, changes were headers and a couple of wonky textual diffs. Nothing functional (incl tests).

Copy link
Contributor

@michael-redpanda michael-redpanda left a comment

Choose a reason for hiding this comment

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

eyeballed the original PR and this one and appears to be good

@oleiman
Copy link
Member Author

oleiman commented Feb 23, 2024

Thanks @michael-redpanda!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/redpanda area/wasm WASM Data Transforms kind/backport PRs targeting a stable branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants