Skip to content

server: add shared objects to provider share updates - #97

Merged
littlegrasscao merged 3 commits into
mainfrom
server/split2/08-shared-objects
Oct 21, 2026
Merged

littlegrasscao merged 3 commits into
mainfrom
server/split2/08-shared-objects

Conversation

@littlegrasscao

@littlegrasscao littlegrasscao commented Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • add SharedDataObjectEntity persistence and ADD / REMOVE object updates to the provider PATCH /shares/{share} API
    • an add resolves the object through CatalogConnector.resolveAsset as the caller, checks its declared type, and records the catalog's asset id and table format. The catalog checks that the caller may select from it
    • sharedAs defaults to the name without its catalog; aliases and source names are unique within a share, and a schema and tables under it cannot both be shared
    • a remove names the object by sharedAs or by catalog name, and must match its type
    • GET /shares/{share}?include_shared_data=true returns the objects; deleting a share deletes them
  • an update is atomic, as in Databricks UpdateShare: every remove runs, then every add, then the share's field changes, in one database transaction. If any of them fails, the transaction rolls back and the share is unchanged
    • catalog lookups for the adds finish before the transaction opens, so it holds no connection during remote calls; a catalog failure also leaves the share unchanged
    • because removes run first, an add may reuse an alias that the same request removes, whatever the order of updates
  • only the share owner may update it; the share's row lock from server: add provider-admin share entities and CRUD #96 makes concurrent updates run one at a time, so the schema and table checks see each other's adds

Testing

  • mvn clean install: 94 tests passed
  • ShareAdminServiceTest: adding and removing tables and schemas, default and explicit aliases, unsupported types, duplicate aliases and sources, schema and table conflicts, and removes that need a type and an existing object
  • ShareUpdateTransactionTest:
    • removing a table and adding another, then adding a conflicting schema, returns 409; the removed table is still shared, the added table is not, and the comment is unchanged
    • a remove followed by an add the catalog rejects leaves the removed table in the share
    • an add that reuses the alias of a later remove in the same request succeeds
  • ShareUpdateConcurrencyTest: adding a schema and a table under it at the same time leaves only one of them (the other is 409), and an update racing a delete gets 200 or 404

Stacked on #96.

@littlegrasscao
littlegrasscao force-pushed the server/split2/08-shared-objects branch from 2f342b5 to 3723e47 Compare September 16, 2026 23:02
@littlegrasscao
littlegrasscao marked this pull request as ready for review September 17, 2026 23:26
@littlegrasscao
littlegrasscao force-pushed the server/split2/08-shared-objects branch 2 times, most recently from 488019c to fb2e147 Compare September 18, 2026 20:14
@littlegrasscao
littlegrasscao force-pushed the server/split2/08-shared-objects branch 2 times, most recently from 619cd87 to 642f916 Compare September 25, 2026 22:18
@littlegrasscao
littlegrasscao force-pushed the server/split2/08-shared-objects branch from 642f916 to 5a1302f Compare September 25, 2026 22:27
@littlegrasscao
littlegrasscao force-pushed the server/split2/08-shared-objects branch from 5a1302f to 21bdfca Compare September 25, 2026 22:32
@littlegrasscao
littlegrasscao force-pushed the server/split2/08-shared-objects branch from 21bdfca to c245c38 Compare September 25, 2026 22:37
@littlegrasscao
littlegrasscao requested a review from zhu-tom October 1, 2026 00:17
@zhu-tom
zhu-tom added this pull request to stack #111 October 1, 2026 18:55
@littlegrasscao
littlegrasscao removed this pull request from stack #111 October 1, 2026 20:19
@littlegrasscao
littlegrasscao added this pull request to stack #112 October 1, 2026 20:20
@littlegrasscao
littlegrasscao force-pushed the server/split2/08-shared-objects branch from c245c38 to ac8e380 Compare October 2, 2026 16:13
@littlegrasscao
littlegrasscao force-pushed the server/split2/08-shared-objects branch 2 times, most recently from 459d7ef to f91ffa9 Compare October 5, 2026 20:57
@littlegrasscao
littlegrasscao force-pushed the server/split2/08-shared-objects branch from f91ffa9 to 80683f5 Compare October 5, 2026 21:25
@littlegrasscao
littlegrasscao force-pushed the server/split2/08-shared-objects branch from 80683f5 to 025625f Compare October 5, 2026 23:59
@littlegrasscao
littlegrasscao force-pushed the server/split2/08-shared-objects branch from 025625f to c76e04c Compare October 6, 2026 00:05
@littlegrasscao
littlegrasscao force-pushed the server/split2/08-shared-objects branch from c76e04c to 4260b9f Compare October 6, 2026 00:14
@littlegrasscao
littlegrasscao force-pushed the server/split2/08-shared-objects branch 2 times, most recently from 64ad59d to 19ddd3f Compare October 9, 2026 23:35
@littlegrasscao
littlegrasscao force-pushed the server/split2/08-shared-objects branch 2 times, most recently from dc3c084 to 65393c0 Compare October 13, 2026 23:54
@littlegrasscao
littlegrasscao force-pushed the server/split2/08-shared-objects branch from 65393c0 to 7f85ceb Compare October 14, 2026 00:56
@littlegrasscao
littlegrasscao force-pushed the server/split2/08-shared-objects branch 2 times, most recently from 64279ba to 1535e31 Compare October 15, 2026 16:46
@littlegrasscao
littlegrasscao force-pushed the server/split2/08-shared-objects branch 5 times, most recently from 1f2039a to 0cf3cc8 Compare October 20, 2026 00:05
Base automatically changed from server/split2/07-provider-shares to main October 21, 2026 17:01
@littlegrasscao
littlegrasscao force-pushed the server/split2/08-shared-objects branch from 0cf3cc8 to 4d4f55e Compare October 21, 2026 17:01
@littlegrasscao
littlegrasscao merged commit d8945d8 into main Oct 21, 2026
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