8000 Create new Message Envelope page with new 25.2 features by katmayb · Pull Request #19542 · cockroachdb/docs · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Create new Message Envelope page with new 25.2 features #19542

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

Merged
merged 9 commits into from
May 19, 2025

Conversation

katmayb
Copy link
Contributor
@katmayb katmayb commented Apr 23, 2025

Fixes DOC-11555, DOC-12241, DOC-12307

This PR adds the new enriched envelope format for changefeed messages to docs and restructures our content on changefeed message envelopes.

Includes:

New Changefeed Message Envelope page

  • Use case example for new and existing options
  • Field reference
  • Envelope option reference
  • Preview label for enriched envelope content
  • Content on envelopes moved from the Changefeed Messages page
  • A general overview on envelopes and intro

Other

  • Removed the envelope content from here to the new page.
  • Adjustments to option descriptions on the CREATE CHANGEFEED page.

Preview

New Changefeed Message Envelope page

Copy link
netlify bot commented Apr 23, 2025

Deploy Preview for cockroachdb-interactivetutorials-docs canceled.

Name Link
🔨 Latest commit 3a5c716
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-interactivetutorials-docs/deploys/682b7ea4cfc549000841787e

Copy link
netlify bot commented Apr 23, 2025

Deploy Preview for cockroachdb-api-docs canceled.

Name Link
🔨 Latest commit 3a5c716
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-api-docs/deploys/682b7ea4bd9a73000803c5a7

Copy link
netlify bot commented Apr 23, 2025

Netlify Preview

Name Link
🔨 Latest commit 3a5c716
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-docs/deploys/682b7ea4b4776b000897353c
😎 Deploy Preview https://deploy-preview-19542--cockroachdb-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@katmayb katmayb force-pushed the message-envelope-25.2 branch 4 times, most recently from 6804b9d to d33b480 Compare May 1, 2025 15:48
<a id="resolved-option"></a>`resolved` | Emit `resolved` timestamps in a format depending on the connected sink. **Note:** The `resolved` timestamp is emitted as a separate message, and has its own envelope containing a `resolved` key and a timestamp value as a string. For more details on the `resolved` options, refer to [Resolved messages]({% link {{ page.version.version }}/changefeed-messages.md %}#resolved-messages). | All
<a id="updated-option"></a>`updated` | Add an [`"updated"`](#updated) timestamp field to each message, showing the commit time of the change. When the changefeed runs an initial scan or a [schema change backfill]({% link {{ page.version.version }}/changefeed-messages.md %}#schema-changes-with-column-backfill), the `"updated"` field will reflect the time of the scan or backfill, not the MVCC timestamp. If you use `updated` with [`enriched_properties=source`](#enriched-properties-option), the `"updated"` field will be replaced with `"ts_ns"` and `"ts_hlc"` in the [`"source"`](#source) fields. **Note:** `envelope=enriched` with the `updated` option will not produce a change event commit timestamp in the message—to include the timestamp, use `updated` with `envelope=enriched, enriched_properties=source, updated`. | All

### `envelope` option examples
Copy link
Contributor Author

Choose a reason for hiding this comment

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

All this content except the enriched part was existing.

New content begins again in the Field Reference section.

@katmayb katmayb changed the title WIP Create new Message Envelope page with new 25.2 features Create new Message Envelope page with new 25.2 features May 1, 2025
@katmayb katmayb marked this pull request as ready for review May 1, 2025 15:50
@katmayb katmayb requested review from rohan-joshi, asg0451 and aerfrei May 1, 2025 15:58
Copy link
@aerfrei aerfrei left a comment

Choose a reason for hiding this comment

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

I read through the new page. Everything was clear and accurate! Thanks so much for this

Copy link
@asg0451 asg0451 left a comment

Choose a reason for hiding this comment

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

can you also add a note either to the ordering guarantees or to the ts_ns enriched section like we discussed?

CREATE CHANGEFEED FOR TABLE products INTO 'kafka://localhost:9092' WITH envelope=enriched, enriched_properties=source, updated;
~~~
~~~
{"after": {"category": "Home & Kitchen", "created_at": "2025-04-30T20:02:35.40316", "description": "Adjustable LED desk lamp with touch controls", "id": "4b36388a-f7e6-4b95-9f78-3aee9e2060d6", "in_stock": true, "name": "LED Desk Lamp", "price": 22.30}, "op": "c", "source": {"changefeed_sink": "kafka", "cluster_id": "585e6512-ea54-490a-8f1d-50c8d182a2e6", "cluster_name": "", "database_name": "test", "db_version": "v25.2.0-beta.2", "job_id": "1068153948173991937", "node_id": "1", "node_name": "localhost", "origin": "cockroachdb", "primary_keys": ["id"], "schema_name": "public", "source_node_locality": "", "table_name": "products", "ts_hlc": "1746045115619002000.0000000000", "ts_ns": 1746045115619002000}, "ts_ns": 1746045115679811000}
Copy link

Choose a reason for hiding this comment

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

this is annoying to read. maybe we should split it across multiple lines?


### `"payload"`

The change event data. `"payload"` is a wrapper only with [webhook]({% link {{ page.version.version }}/changefeed-sinks.md %}#webhook-sink) sinks and when the [`enriched_properties`](#enriched-properties-option) options is used.
Copy link

Choose a reason for hiding this comment

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

i guess there are two different payloads in question here, which is a little confusing. can you try to disambiguate them?

Copy link

Choose a reason for hiding this comment

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

maybe this organization/format doesnt make that much sense given that we're mixing fields from various envelopes together. this makes it seem like you can get all these fields but actually you only get a subset depending on envelope

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added bullet points to the payload section to call out the difference between the two types of payload wrappers mentioned here. Lmk if you wanted something else.

As a reference, I think this works fine, and each description comes with the option/configuration that enables that field. The alternative would involve every combination as an example that imo would be harder to reference. Given the large number of examples already on this page, I'd like to give this format a shot, but be ready to adapt if we get signal this isn't working.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I also think the fields and options are kind of ripe for automation something like what docs do for the cluster settings page; however, that is a much bigger project for another day involving more stakeholders.

@katmayb
Copy link
Contributor Author
katmayb commented May 9, 2025

can you also add a note either to the ordering guarantees or to the ts_ns enriched section like we discussed?

Added similar language to what was already in the PR, in the ts_ns field ref spot and within the Ordering Guarantees section on the other Message page.

Copy link
@rohan-joshi rohan-joshi left a comment

Choose a reason for hiding this comment

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

looks good to me

@katmayb katmayb requested a review from rmloveland May 12, 2025 19:55
Copy link
Contributor
@rmloveland rmloveland left a comment

Choose a reason for hiding this comment

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

LGTM


~~~json
{
"payload": {
Copy link

Choose a reason for hiding this comment

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

  • now we're demoing an enriched envelope? the text didnt say that. i thought we were still talking about wrapped.
  • payload wrapper only present if schema is

Copy link

Choose a reason for hiding this comment

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

this is still a problem i think. you switch envelope types without mentioning it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@asg0451 Latest commit removes the entire Overview section. This was just meant to be a high-level of the envelope features before the use case section, but mostly duplicates information that is throughout this page. Because this isn't landing, I've removed and moved the links to the content on the page into the introductory paragraphs. This should resolve the issue here.

@katmayb katmayb force-pushed the message-envelope-25.2 branch from fd9f508 to 9b9cc06 Compare May 14, 2025 21:02
Copy link
@rohan-joshi rohan-joshi left a comment

Choose a reason for hiding this comment

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

lgtm

@katmayb katmayb requested a review from asg0451 May 16, 2025 14:42
@katmayb katmayb force-pushed the message-envelope-25.2 branch from 9eef7b6 to 88b1fb7 Compare May 16, 2025 18:43
@katmayb
Copy link
Contributor Author
katmayb commented May 16, 2025

@asg0451 Please take another look, I've addressed each of the requested changes and the further comment.

Copy link
@asg0451 asg0451 left a comment

Choose a reason for hiding this comment

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

looking better -- besides my one comment, the only thing missing is the addendum to the ordering guarantees

10000

It is important to consider that a full-fidelity envelope increases the size of each message significantly, which can have an impact on changefeed throughput.

Use the [`mvcc_timestamp`](#mvcc-timestamp-option), [`envelope=enriched, enriched_properties='source,schema'`](#enriched-properties-option), [`diff`](#diff-option), and [`key_in_value`](#key-in-value-option) (for Kafka) options with [`CREATE CHANGEFEED`]({% link {{ page.version.version }}/create-changefeed.md %}) to create a full-fidelity envelope:
Copy link

Choose a reason for hiding this comment

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

add updated

@katmayb katmayb force-pushed the message-envelope-25.2 branch from 1f0e285 to 3a5c716 Compare May 19, 2025 18:55
@katmayb katmayb merged commit 13661c3 into main May 19, 2025
6 checks passed
@katmayb katmayb deleted the message-envelope-25.2 branch May 19, 2025 19:05
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.

5 participants
0