Page MenuHomePhabricator

[identity] Query reserved usernames in FindUserIdentities RPC
ClosedPublic

Authored by bartek on Jul 29 2024, 11:38 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Sep 10, 5:53 PM
Unknown Object (File)
Sat, Sep 7, 1:43 PM
Unknown Object (File)
Sat, Sep 7, 1:43 PM
Unknown Object (File)
Thu, Sep 5, 5:28 AM
Unknown Object (File)
Sun, Sep 1, 4:45 AM
Unknown Object (File)
Sun, Sep 1, 4:44 AM
Unknown Object (File)
Sun, Sep 1, 4:43 AM
Unknown Object (File)
Sat, Aug 31, 8:20 PM
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