Skip to content

Conversation

@github-actions
Copy link
Contributor

Cherry-picked from #43772

### What problem does this PR solve?

Problem Summary:
After deserialized from Gson, the ConcurrentHashMap may become normal
non-threadsafe HashMap,
This may causing following issue:

```
2024-11-12 16:43:53,101 ERROR (stateListener|13) [Env.transferToNonMaster():1921] failed to transfer to non-master.
java.util.ConcurrentModificationException: null
        at java.util.LinkedHashMap$LinkedHashIterator.nextNode(LinkedHashMap.java:756) ~[?:?]
        at java.util.LinkedHashMap$LinkedValueIterator.next(LinkedHashMap.java:783) ~[?:?]
        at org.apache.doris.datasource.CatalogMgr.registerCatalogRefreshListener(CatalogMgr.java:802) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.catalog.Env.postProcessAfterMetadataReplayed(Env.java:1751) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.catalog.Env.transferToNonMaster(Env.java:1899) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.catalog.Env.access$1300(Env.java:347) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.catalog.Env$5.runOneCycle(Env.java:2850) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.common.util.Daemon.run(Daemon.java:119) ~[doris-fe.jar:1.2-SNAPSHOT]
```

This PR rebuild the `idToCatalog` and `nameToCatalog` map in
`gsonPostProcess()` of `CatalogMgr`,
to solve the issue.
@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@doris-robot
Copy link

run buildall

@yiguolei yiguolei closed this Nov 16, 2024
@yiguolei yiguolei reopened this Nov 16, 2024
@yiguolei yiguolei merged commit 03eae76 into branch-2.1 Nov 16, 2024
@dataroaring dataroaring deleted the auto-pick-43772-branch-2.1 branch December 27, 2024 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants