Page MenuHomePhabricator

[identity] Query reserved usernames in FindUserIdentities RPC
ClosedPublic

Authored by bartek on Jul 29 2024, 11:38 AM.
Tags
None
Referenced Files
F3567696: D12924.diff
Fri, Dec 27, 9:35 PM
Unknown Object (File)
Sun, Dec 15, 3:04 AM
Unknown Object (File)
Sun, Dec 15, 3:04 AM
Unknown Object (File)
Sun, Dec 15, 3:04 AM
Unknown Object (File)
Sat, Dec 7, 12:05 PM
Unknown Object (File)
Sat, Dec 7, 12:04 PM
Unknown Object (File)
Wed, Dec 4, 4:16 AM
Unknown Object (File)
Nov 21 2024, 1:37 AM
Subscribers

Details

Summary

Addresses server-side of ENG-8771.
Modified FindUserIdentities RPC to also look up the reserved usernames table.

Depends on D12922, D12923

Test Plan
  • Have a few users registered to identity
  • Manually added a few items to the reserved usernames table.
  • Call the RPC with user IDs from both tables, and also a few non-existent IDs
  • Verify that response contains usernames for both types of users

Also verified that previous methods that base on modified DatabaseClient::query_reserved_usernames_table() work the same way as before.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

bartek held this revision as a draft.
bartek published this revision for review.Jul 29 2024, 12:01 PM
bartek added inline comments.
services/identity/src/database.rs
1259–1265

Introduced this to be able to monitor how big the numbers actually are and if we need to worry about performance

1267–1277

Decided to do a traditional for loop instead of spawning threads, to avoid issues similar to our last OOM incident.
However, if the sequential query becomes too slow, I can try splitting this into chunks and spawn threads for each chunk of let's say 5-10 requests

Unfortunately, we cannot do anything like BatchGet here because we're querying an index.

services/identity/src/grpc_services/authenticated.rs
875–880

I hope this will limit the number of queried user IDs over time. The more users registered on Identity we have, the less users will stay in the reserved usernames table

This revision is now accepted and ready to land.Jul 29 2024, 10:23 PM

Rename to reserved_user_identifiers