Implement RFC 7047 JSON-RPC Client for OVSDB #23872
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR: Implement RFC 7047 JSON-RPC Client for OVSDB
What this PR does / why we need it:
This PR introduces a native pure-Go JSON-RPC client for OVSDB in
vendor/yunion.io/x/ovsdb/client. This implementation adheres to RFC 7047 and allows the application to interact directly with OVN Northbound/Southbound databases without relying on externalovn-nbctlprocesses. This improves performance, transaction atomicity, and enables real-time state synchronization via OVSDB monitoring.Key Changes:
Client(client.go, rpc.go) which manages persistent TCP/Unix connections and handles the JSON-RPC 1.0 request/response lifecycle, including async notifications.MonitorDB(monitor.go) which leverages reflection to map OVSDB table updates directly into the generated Go structs found in yunion.io/x/ovsdb/schema/ovn_nb. This allows for maintaining an automatic, real-time in-memory cache of the database.TransactOps(transact.go) to support atomic operations (Insert, Update, Delete, Mutate) with automatic, schema-aware serialization of Go structs to OVSDB JSON format.cmd/ovsdb-checkto verify connection establishment, monitoring synchronization, and transaction execution.cmd/ovsdb-check)