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

[Refactor](query) refactor lock in fragment mgr and change std::unorder_map to phmap #44821 #45232

Conversation

zhiqiang-hhhh
Copy link
Contributor

cherry pick from #44821

@zhiqiang-hhhh
Copy link
Contributor Author

run buildall

@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?

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

Status FragmentMgr::_get_query_ctx(const Params& params, TUniqueId query_id, bool pipeline,
QuerySource query_source,
std::shared_ptr<QueryContext>& query_ctx) {
Status FragmentMgr::_get_or_create_query_ctx(const TPipelineFragmentParams& params,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function '_get_or_create_query_ctx' has cognitive complexity of 69 (threshold 50) [readability-function-cognitive-complexity]

Status FragmentMgr::_get_or_create_query_ctx(const TPipelineFragmentParams& params,
                    ^
Additional context

be/src/runtime/fragment_mgr.cpp:666: +1, including nesting penalty of 0, nesting level increased to 1

    DBUG_EXECUTE_IF("FragmentMgr._get_query_ctx.failed", {
    ^

be/src/util/debug_points.h:36: expanded from macro 'DBUG_EXECUTE_IF'

    if (UNLIKELY(config::enable_debug_points)) {                              \
    ^

be/src/runtime/fragment_mgr.cpp:666: +2, including nesting penalty of 1, nesting level increased to 2

    DBUG_EXECUTE_IF("FragmentMgr._get_query_ctx.failed", {
    ^

be/src/util/debug_points.h:38: expanded from macro 'DBUG_EXECUTE_IF'

        if (dp) {                                                             \
        ^

be/src/runtime/fragment_mgr.cpp:674: +1, including nesting penalty of 0, nesting level increased to 1

    if (params.is_simplified_param) {
    ^

be/src/runtime/fragment_mgr.cpp:676: +2, including nesting penalty of 1, nesting level increased to 2

        if (!query_ctx) {
        ^

be/src/runtime/fragment_mgr.cpp:682: +1, nesting level increased to 1

    } else {
      ^

be/src/runtime/fragment_mgr.cpp:683: +2, including nesting penalty of 1, nesting level increased to 2

        if (!query_ctx) {
        ^

be/src/runtime/fragment_mgr.cpp:687: +3, including nesting penalty of 2, nesting level increased to 3

            if (search != _query_ctx_map.end()) {
            ^

be/src/runtime/fragment_mgr.cpp:691: +3, including nesting penalty of 2, nesting level increased to 3

            if (!query_ctx) {
            ^

be/src/runtime/fragment_mgr.cpp:705: +4, including nesting penalty of 3, nesting level increased to 4

                RETURN_IF_ERROR(DescriptorTbl::create(&(query_ctx->obj_pool), params.desc_tbl,
                ^

be/src/common/status.h:632: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/runtime/fragment_mgr.cpp:705: +5, including nesting penalty of 4, nesting level increased to 5

                RETURN_IF_ERROR(DescriptorTbl::create(&(query_ctx->obj_pool), params.desc_tbl,
                ^

be/src/common/status.h:634: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/runtime/fragment_mgr.cpp:708: +4, including nesting penalty of 3, nesting level increased to 4

                if (params.__isset.file_scan_params) {
                ^

be/src/runtime/fragment_mgr.cpp:714: +4, including nesting penalty of 3, nesting level increased to 4

                if (params.__isset.resource_info) {
                ^

be/src/runtime/fragment_mgr.cpp:722: +4, including nesting penalty of 3, nesting level increased to 4

                if (params.__isset.workload_groups && !params.workload_groups.empty()) {
                ^

be/src/runtime/fragment_mgr.cpp:722: +1

                if (params.__isset.workload_groups && !params.workload_groups.empty()) {
                                                   ^

be/src/runtime/fragment_mgr.cpp:726: +5, including nesting penalty of 4, nesting level increased to 5

                    if (workload_group_ptr != nullptr) {
                    ^

be/src/runtime/fragment_mgr.cpp:727: +6, including nesting penalty of 5, nesting level increased to 6

                        RETURN_IF_ERROR(workload_group_ptr->add_query(query_id, query_ctx));
                        ^

be/src/common/status.h:632: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/runtime/fragment_mgr.cpp:727: +7, including nesting penalty of 6, nesting level increased to 7

                        RETURN_IF_ERROR(workload_group_ptr->add_query(query_id, query_ctx));
                        ^

be/src/common/status.h:634: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/runtime/fragment_mgr.cpp:728: +6, including nesting penalty of 5, nesting level increased to 6

                        RETURN_IF_ERROR(query_ctx->set_workload_group(workload_group_ptr));
                        ^

be/src/common/status.h:632: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/runtime/fragment_mgr.cpp:728: +7, including nesting penalty of 6, nesting level increased to 7

                        RETURN_IF_ERROR(query_ctx->set_workload_group(workload_group_ptr));
                        ^

be/src/common/status.h:634: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/runtime/fragment_mgr.cpp:731: +1, nesting level increased to 5

                    } else {
                      ^

@zhiqiang-hhhh zhiqiang-hhhh deleted the pick_44821_to_upstream_branch-3.0 branch December 11, 2024 07:20
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.

3 participants