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

Forbid changes to protobuf structs' field names that are persited in meta #15030

Closed
Tracked by #12449
xxchan opened this issue Feb 6, 2024 — with Slack · 1 comment
Closed
Tracked by #12449

Forbid changes to protobuf structs' field names that are persited in meta #15030

xxchan opened this issue Feb 6, 2024 — with Slack · 1 comment
Milestone

Comments

Copy link
Member

xxchan commented Feb 6, 2024

SQL meta store relies on the name of fields. (serialized to JSON)

derive_from_json_struct!(DataType, risingwave_pb::data::DataType);
derive_from_json_struct!(DataTypeArray, Vec<risingwave_pb::data::DataType>);
derive_from_json_struct!(FieldArray, Vec<risingwave_pb::plan_common::Field>);
derive_from_json_struct!(Property, HashMap<String, String>);
derive_from_json_struct!(ColumnCatalog, risingwave_pb::plan_common::PbColumnCatalog);
derive_from_json_struct!(
ColumnCatalogArray,
Vec<risingwave_pb::plan_common::PbColumnCatalog>
);
derive_from_json_struct!(StreamSourceInfo, risingwave_pb::catalog::PbStreamSourceInfo);
derive_from_json_struct!(WatermarkDesc, risingwave_pb::catalog::PbWatermarkDesc);
derive_from_json_struct!(
WatermarkDescArray,
Vec<risingwave_pb::catalog::PbWatermarkDesc>
);
derive_from_json_struct!(ExprNodeArray, Vec<risingwave_pb::expr::PbExprNode>);
derive_from_json_struct!(ColumnOrderArray, Vec<risingwave_pb::common::PbColumnOrder>);
derive_from_json_struct!(SinkFormatDesc, risingwave_pb::catalog::PbSinkFormatDesc);
derive_from_json_struct!(Cardinality, risingwave_pb::plan_common::PbCardinality);
derive_from_json_struct!(TableVersion, risingwave_pb::catalog::table::PbTableVersion);
derive_from_json_struct!(
PrivateLinkService,
risingwave_pb::catalog::connection::PbPrivateLinkService
);
derive_from_json_struct!(AuthInfo, risingwave_pb::user::PbAuthInfo);
derive_from_json_struct!(ConnectorSplits, risingwave_pb::source::ConnectorSplits);
derive_from_json_struct!(VnodeBitmap, risingwave_pb::common::Buffer);
derive_from_json_struct!(ActorMapping, risingwave_pb::stream_plan::PbActorMapping);
derive_from_json_struct!(ExprContext, risingwave_pb::plan_common::PbExprContext);
derive_from_json_struct!(
FragmentVnodeMapping,
risingwave_pb::common::ParallelUnitMapping
);

We need to revert this change and set the check level back to WIRE_JSON
#8365

Slack Message

Maybe we can only change the level for meta.proto without changing others'. (That may need us to split the proto into modules and apply different buf.yaml?)

@xiangjinwu
Copy link
Contributor

xiangjinwu commented Jul 8, 2024

https://protobuf.dev/programming-guides/dos-donts/#text-format-interchange

Don’t use Text Format Messages for Interchange
Use binary serialization when possible for data interchange, and use text format for human editing and debugging only.

(Context: I was thinking to promote a boolean into a 3-value (or more in the future) enum, which is wire-compatible.)

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

No branches or pull requests

2 participants