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

[server] remove setting sync record with limit #8644

Merged
merged 1 commit into from
Mar 11, 2022
Merged

[server] remove setting sync record with limit #8644

merged 1 commit into from
Mar 11, 2022

Conversation

mustard-mh
Copy link
Contributor

@mustard-mh mustard-mh commented Mar 7, 2022

Description

Origin code looks fine. So sync-data more than 20, maybe it's caused by db-sync.

This PR will alleviate this problem.

Related Issue(s)

Fixes #8589

How to test

  1. Start a workspace
  2. Adjust UI and toggle setting sync to reach config limit 2 (debug only)
  3. Repeat prev step, watch minio files and DB record

How to access minio with UI

# make sure using correct namespace
kubens staging-hw-fix-8589

# get user and psw
kubectl get secrets minio -oyaml | yq - r "data.root-user" | base64 -d
kubectl get secrets minio -oyaml | yq - r "data.root-password" | base64 -d

# port forward minio console to 1234 (whatever you want)
kubectl pord-forward service/minio 1234:9001

# open port in your browser!! 

How to access your configuration?

Buckets -> search with your userId (Chrome DevTools to get it) -> Browser details -> blobs -> code-data -> globalState(which store your UI setting)

How to access setting sync table

# get psw
kubectl get secrets mysql -oyaml | yq - r "data.password" | base64 -d

# exec into mysql
kubectl exec -it mysql-0 -c mysql sh

# get your data
mysql -u gitpod -p # then enter your password
use gitpod;
SELECT * FROM d_b_code_sync_resource WHERE userId=<your_user_id>;

How to trigger UI update request to server

Drag your DEBUG CONSOLE to TERMINAL (any of them)

Image
image

Release Notes

Fix setting sync limit failure in some cases

Documentation

@mustard-mh mustard-mh requested a review from a team March 7, 2022 18:32
@github-actions github-actions bot added the team: webapp Issue belongs to the WebApp team label Mar 7, 2022
@mustard-mh
Copy link
Contributor Author

mustard-mh commented Mar 7, 2022

/hold

  • Need to remove debug commit
  • Need to squash commits

@codecov
Copy link

codecov bot commented Mar 7, 2022

Codecov Report

Merging #8644 (c8a60b9) into main (f608089) will not change coverage.
The diff coverage is n/a.

❗ Current head c8a60b9 differs from pull request most recent head 04a9133. Consider uploading reports for the commit 04a9133 to get more accurate results

@@           Coverage Diff           @@
##             main    #8644   +/-   ##
=======================================
  Coverage   28.14%   28.14%           
=======================================
  Files          60       60           
  Lines        8308     8308           
=======================================
  Hits         2338     2338           
- Misses       5793     5794    +1     
+ Partials      177      176    -1     
Flag Coverage Δ
components-ee-agent-smith-app 40.30% <ø> (+0.26%) ⬆️
components-ee-agent-smith-lib 40.03% <ø> (-0.27%) ⬇️
components-gitpod-cli-app 11.17% <ø> (ø)
components-gitpod-protocol-go-lib ∅ <ø> (∅)
components-ide-code-codehelper-app ∅ <ø> (∅)
components-local-app-app-darwin-amd64 ∅ <ø> (?)
components-local-app-app-darwin-arm64 ∅ <ø> (?)
components-local-app-app-linux-amd64 19.04% <ø> (ø)
components-local-app-app-linux-arm64 ?
components-local-app-app-windows-386 ?
components-local-app-app-windows-amd64 ?
components-local-app-app-windows-arm64 ∅ <ø> (∅)
components-supervisor-app 35.32% <ø> (ø)
install-installer-raw-app 4.27% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
components/supervisor/pkg/config/gitpod-config.go 76.78% <0.00%> (-2.68%) ⬇️
components/supervisor/pkg/ports/ports.go 58.59% <0.00%> (+0.51%) ⬆️

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@mustard-mh mustard-mh marked this pull request as ready for review March 7, 2022 19:21
@jeanp413
Copy link
Member

jeanp413 commented Mar 7, 2022

@mustard-mh For globalState resource I see 31 revs, did you found something that causes this?
image

@jeanp413 jeanp413 self-requested a review March 7, 2022 19:50
@mustard-mh
Copy link
Contributor Author

mustard-mh commented Mar 8, 2022

@mustard-mh For globalState resource I see 31 revs, did you found something that causes this?

@jeanp413 I think it's because of db-sync.

Original code looks fine, and it's correct with self-hosted Gitpod (one DB only)

@mustard-mh
Copy link
Contributor Author

mustard-mh commented Mar 8, 2022

The original code, only in case of high concurrency, may have this problem. But according to the time of database rows, it is not a high concurrency.

Original code only updates the last record and deletes the last record JSON file.

If there is no high concurrency and only one database, it'll work fine. But we have db-sync, it'll sync other records from another DB, and sometimes causes some bugs, then we get more and more records.

cc @jeanp413

@akosyakov
Copy link
Member

I removed this PR from IDE project and added the corresponding issue instead.

@jeanp413 jeanp413 self-requested a review March 9, 2022 20:24
jeanp413
jeanp413 previously approved these changes Mar 9, 2022
@mustard-mh
Copy link
Contributor Author

I added How to access minio UI and How to access setting sync table section.

cc @jeanp413

@jeanp413 jeanp413 self-requested a review March 10, 2022 13:16
jeanp413
jeanp413 previously approved these changes Mar 10, 2022
geropl
geropl previously approved these changes Mar 11, 2022
@mustard-mh mustard-mh dismissed stale reviews from geropl and jeanp413 via 9890ab3 March 11, 2022 18:48
@mustard-mh
Copy link
Contributor Author

removed debug commit

@mustard-mh mustard-mh requested a review from geropl March 11, 2022 18:48
@mustard-mh
Copy link
Contributor Author

/unhold

@jeanp413
Copy link
Member

jeanp413 commented Mar 11, 2022

need to resolve merge conflicts now 👀

@mustard-mh
Copy link
Contributor Author

mustard-mh commented Mar 11, 2022

/werft run

👍 started the job as gitpod-build-hw-fix-8589.17

@mustard-mh
Copy link
Contributor Author

mustard-mh commented Mar 11, 2022

/werft run no-preview

👍 started the job as gitpod-build-hw-fix-8589.18

@roboquat roboquat merged commit 4f1c392 into main Mar 11, 2022
@roboquat roboquat deleted the hw/fix-8589 branch March 11, 2022 20:56
@roboquat roboquat added deployed: webapp Meta team change is running in production deployed Change is completely running in production labels Mar 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: webapp Meta team change is running in production deployed Change is completely running in production release-note size/L team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Settings sync stores more than 20 resource revisions
6 participants