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

Sync upload local changes reordering patch issue #2500

Open
ndegwamartin opened this issue Mar 26, 2024 · 7 comments · May be fixed by #2524
Open

Sync upload local changes reordering patch issue #2500

ndegwamartin opened this issue Mar 26, 2024 · 7 comments · May be fixed by #2524
Assignees
Labels
effort:medium Medium effort - 3 to 5 days P1 High priority issue

Comments

@ndegwamartin
Copy link
Collaborator

Describe the bug
After the latest updates to Sync, an exception is thrown on the code block/line here :

private fun createTopologicalOrderedList(adjacencyList: Map<Node, List<Node>>): List<Node> {
    val stack = ArrayDeque<String>()
    val visited = mutableSetOf<String>()
    val currentPath = mutableSetOf<String>()

    fun dfs(key: String) {
      check(currentPath.add(key)) { "Detected a cycle." }
      if (visited.add(key)) {

The check throws an exception if it detects a cycle, however there could be valid cycles .

See screenshot (Shows breakpoint debugging of code block/line above )

Component
Core library - Engine

To Reproduce
Steps to reproduce the behavior:

  1. Trigger sync upload after a workflow that creates resources with a dependency tree as shown on the screenshot.

Expected behavior
Sync upload should be successful

Screenshots
Screenshot 2024-03-26 at 15 14 50

Screenshot shows breakpoint debugging of line here

Smartphone (please complete the following information):
N/A

Additional context
N/A

Would you like to work on the issue?
@aditya-07 worked on the original issue

@aditya-07
Copy link
Collaborator

@ndegwamartin Can you add some data for the valid cycle.

@santosh-pingle
Copy link
Collaborator

santosh-pingle commented Apr 1, 2024

@ndegwamartin Did you share the data with @aditya-07 for the valid cycle?
@ndegwamartin Do you mean the resources are already in sync, and it only throws exceptions when uploading updates during a valid cycle?

@santosh-pingle santosh-pingle added the P1 High priority issue label Apr 1, 2024
@fredhersch fredhersch added the effort:medium Medium effort - 3 to 5 days label Apr 1, 2024
@ndegwamartin
Copy link
Collaborator Author

@aditya @santosh-pingle for context the above screenshot was captured after migrating to the latest codebase.

Attached is the SQL to recreate the state of the LocalChangeEntity and LocalChangeResourceReferenceEntity
resources_db-LocalChanges.sql.zip . Let me know if you need data from any of the other tables.

I'm also happy to jump on a call to clarify further

@ndegwamartin
Copy link
Collaborator Author

@aditya-07 related to the above these are the resources(count by resource type) that could not be synced via Upload

Screenshot 2024-04-03

@aditya-07
Copy link
Collaborator

@aditya @santosh-pingle for context the above screenshot was captured after migrating to the latest codebase.

Attached is the SQL to recreate the state of the LocalChangeEntity and LocalChangeResourceReferenceEntity resources_db-LocalChanges.sql.zip . Let me know if you need data from any of the other tables.

I'm also happy to jump on a call to clarify further

@ndegwamartin The .zip doesn't have sql to recreate LocalChangeResourceReferenceEntity .

@ndegwamartin
Copy link
Collaborator Author

@aditya-07 you are correct, appears the LocalChangeResourceReferenceEntity was not part of the archive. I've recreated the scripts with a new data set attached here - LocalChangesSQL.zip

Screenshot 2024-04-05 at 15 18 51

@pld
Copy link
Collaborator

pld commented Apr 17, 2024

hi @aditya-07 any update on progress here? Thank you!

@aditya-07 aditya-07 linked a pull request Apr 23, 2024 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort:medium Medium effort - 3 to 5 days P1 High priority issue
Projects
Status: Backlog
Development

Successfully merging a pull request may close this issue.

5 participants