Skip to content

RPCs for op head reconciliation - #39

Open
sidracha wants to merge 1 commit into
srachaba-1-proto-conversionsfrom
srachaba-2-reconcile-rpc
Open

sidracha wants to merge 1 commit into
srachaba-1-proto-conversionsfrom
srachaba-2-reconcile-rpc

Conversation

@sidracha

@sidracha sidracha commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

proto: add RPCs for op head reconciliation

server: add server-side handler for op head reconciliation request

This handler is called when the client wants to reconcile op heads (used on most jj cli function calls). It queries the storage layer, and if there is only 1 op head for the repo, returns. If there are more, it will call the server-side internal reconciliation function, which is left for the following commits.

}

message ReconcileOpHeadsResponse {
bytes op_head = 1;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think it is much better to have types for the main entities, for example:

message OperationId {
  bytes id_bytes = 1;
}

Similarly, some sort of type representing a repo id.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Introducing the wrapper message types may require lots of small but tedious changes, and you don't have much time left in your internship, so feel free to leave TODOs for now if you want.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Adding types for these requires a bigger rewrite across the client as well as the server...

Requires Returning Some(OperationId { id_bytes }) in responses (ReconcileOpHeadsResponse, WriteOperationResponse, etc.) on the server side and modifying the client to package it with that type on RPC requests.

This is definitely cleaner to do in a standalone PR, so I've added TODOS at the top of op_store.proto and backend.proto to make this a clear TODO

}

message ReconcileOpHeadsResponse {
bytes op_head = 1;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Introducing the wrapper message types may require lots of small but tedious changes, and you don't have much time left in your internship, so feel free to leave TODOs for now if you want.

server: add server-side handler for op head reconciliation request

This handler is called when the client wants to reconcile op heads (used on most jj cli function calls). It queries the storage layer, and if there is only 1 op head for the repo, returns. If there are more, it will call the server-side internal reconciliation function, which is left for the following commits.
@sidracha
sidracha force-pushed the srachaba-2-reconcile-rpc branch from c901932 to d8dad16 Compare September 14, 2026 20:59
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.

2 participants