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

Federation: Implement ID mapping (galley) #1134

Merged
merged 33 commits into from
Jul 8, 2020

Conversation

mheinzel
Copy link
Contributor

@mheinzel mheinzel commented Jun 9, 2020

@mheinzel mheinzel force-pushed the mheinzel/federation-implement-uuid-mapping branch 4 times, most recently from bf1a380 to 2faf6ac Compare June 10, 2020 13:15
@mheinzel mheinzel changed the title [WIP] Federation: Implement UUID mapping Federation: Implement UUID mapping Jun 10, 2020
@mheinzel
Copy link
Contributor Author

The implementation for Galley is mostly done, so let's start getting this tested in CI. Feedback is very welcome, there are just a few important TODOs I'd like to ponder and/or discuss before doing very similar work in Brig.

@mheinzel mheinzel force-pushed the mheinzel/federation-implement-uuid-mapping branch from 2faf6ac to 064cdd8 Compare June 10, 2020 13:58
@@ -325,6 +326,25 @@ CREATE TABLE galley_test.legalhold_service (
AND read_repair_chance = 0.0
AND speculative_retry = '99PERCENTILE';

CREATE TABLE galley_test.uuid_mapping (
local_id uuid PRIMARY KEY,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

UPDATE: Let's call the field mapped_id.
Also rename the table from uuid_mapping to id_mapping


selectIdMapping :: PrepQuery R (Identity (Id (Mapped a))) (Id (Remote a), Domain)
selectIdMapping =
"select remote_id, remote_domain from uuid_mapping where local_id = ?"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

UPDATE: we can also return local_id/mapped_id here, which makes getIdMapping simpler.

@mheinzel mheinzel force-pushed the mheinzel/federation-implement-uuid-mapping branch from 71432b1 to 02a3b88 Compare June 12, 2020 14:46
@mheinzel mheinzel marked this pull request as ready for review June 12, 2020 14:48
@mheinzel
Copy link
Contributor Author

I rebased and addressed all the things we talked about. @arianvp do you want to take another look?

I suggest we do a separate PR for the corresponding changes in Brig. The only thing that I might still squeeze in is batch resolving of opaque IDs, but it could also go into a follow-up PR.

@mheinzel mheinzel changed the title Federation: Implement UUID mapping Federation: Implement UUID mapping (galley) Jun 12, 2020
@mheinzel mheinzel force-pushed the mheinzel/federation-implement-uuid-mapping branch from 02a3b88 to 0f14c5a Compare June 12, 2020 17:44
@mheinzel
Copy link
Contributor Author

Rebased again, I think it's done from my side now.

@mheinzel mheinzel requested a review from arianvp June 12, 2020 17:46
@mheinzel mheinzel force-pushed the mheinzel/federation-implement-uuid-mapping branch 2 times, most recently from bb09624 to f5979a3 Compare June 23, 2020 09:15
@mheinzel mheinzel force-pushed the mheinzel/federation-implement-uuid-mapping branch from f5979a3 to 46871f4 Compare July 7, 2020 13:41
services/galley/src/Galley/API/IdMapping.hs Outdated Show resolved Hide resolved
services/galley/src/Galley/API/IdMapping.hs Outdated Show resolved Hide resolved
@mheinzel mheinzel force-pushed the mheinzel/federation-implement-uuid-mapping branch from 4bf4918 to 55bf8ea Compare July 8, 2020 09:37
@mheinzel mheinzel force-pushed the mheinzel/federation-implement-uuid-mapping branch from 55bf8ea to c14174f Compare July 8, 2020 12:18
@mheinzel
Copy link
Contributor Author

mheinzel commented Jul 8, 2020

Okay, we're having a few issues with CI, but I'm still gonna merge now. The ormolu job didn't get triggered, but it passed on the previous commit and also passes locally.

@mheinzel mheinzel changed the title Federation: Implement UUID mapping (galley) Federation: Implement ID mapping (galley) Jul 8, 2020
@mheinzel mheinzel merged commit d12b48b into develop Jul 8, 2020
@mheinzel mheinzel deleted the mheinzel/federation-implement-uuid-mapping branch July 8, 2020 14:05
@fisx fisx mentioned this pull request Jul 13, 2020
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.

None yet

2 participants