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

Client Changes in Fluid Server Cluster Discovery Feature #9706

Merged
merged 39 commits into from
Apr 20, 2022

Conversation

tianzhu007
Copy link
Contributor

@tianzhu007 tianzhu007 commented Apr 1, 2022

To implement Fluid Server Cluster discovery, we need to add the following changes to the Client side:

  1. New interface (ISession): Used to store the Fluid server cluster’s URLs and session alive flag. This session information will be returned by the discovery call in create session and join session flow. This interface would be deleted and be consumed from service-client package later, once the server-side code is checked-in.
  2. New API to get session information in the driver side: A GET API is called during the join flow to return the correct session information to the client. This api will return the session information if there is an existing session and will create a session and update the session information and then return the session details if there is no live session.
  3. The discoveryEndpoint URL and the enableDiscovery flag will let the driver know if the current workflow needs discovery or not.
  4. We added the noCacheGitManager for historian. When the client creates a new session, we bypass the cache and fetch the summary from storage, and then update the cache. Otherwise, the client might read an outdated summary from a cache in the old cluster. For example:
    • Client A opens a document in the US, generates some ops and closes the session. The final summary with the sequence # 20 is cached.
    • Client B then opens the same document and creates a session in the EU, generates some ops, and closes the session. The final summary with the sequence # 30 is cached in EU.
    • Client A reopens the document from the US and a new session is created. If we do not disable the cache, client A reads the summary with the summary sequence number of 20 which would be incorrect. Therefore, we need to let client A read the summary directly from the storage, instead of the cache, and update the cache with the fetched summary (sequence number 30).

@tianzhu007 tianzhu007 added area: r11s-driver Issues related to r11s driver area: azure fluid relay labels Apr 1, 2022
@tianzhu007 tianzhu007 linked an issue Apr 1, 2022 that may be closed by this pull request
@github-actions github-actions bot added area: driver Driver related issues area: tests Tests to add, test infrastructure improvements, etc public api change Changes to a public API base: main PRs targeted against main branch labels Apr 1, 2022
@tianzhu007 tianzhu007 changed the title Server Changes in Fluid Server Cluster Discovery Feature Driver Changes in Fluid Server Cluster Discovery Feature Apr 1, 2022
@tianzhu007 tianzhu007 changed the title Driver Changes in Fluid Server Cluster Discovery Feature Client Changes in Fluid Server Cluster Discovery Feature Apr 1, 2022
@tianzhu007 tianzhu007 marked this pull request as ready for review April 1, 2022 04:22
@tianzhu007 tianzhu007 requested review from a team as code owners April 1, 2022 04:22
@tianzhu007
Copy link
Contributor Author

    return new socketStorage.DocumentStorageService(

(nit) include parameter names for a better readability?

Refers to: packages/drivers/local-driver/src/localDocumentService.ts:42 in 626fa4e. [](commit_id = 626fa4e, deletion_comment = False)

This is to create a new service based on the existing constructor. We can open the documentStorageService.ts to read the parameter names.

@tianzhu007
Copy link
Contributor Author

tianzhu007 commented Apr 14, 2022

    return new socketStorage.DocumentStorageService(

(nit) include parameter names for a better readability?

Refers to: packages/drivers/local-driver/src/localDocumentService.ts:42 in 626fa4e. [](commit_id = 626fa4e, deletion_comment = False)

I am unable to add the parameter names when creating this object. Based on https://stackoverflow.com/questions/45507428/typescript-create-class-via-constructor-passing-in-named-parameters, we need to rewrite the constructor to realize it. We can keep it as it is right now. :)
Screen Shot 2022-04-13 at 8 56 30 PM

@github-actions github-actions bot added the area: server Server related issues (routerlicious) label Apr 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: azure fluid relay area: driver Driver related issues area: r11s-driver Issues related to r11s driver area: server Server related issues (routerlicious) area: tests Tests to add, test infrastructure improvements, etc base: main PRs targeted against main branch public api change Changes to a public API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fluid Server Discovery
5 participants