You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/07/19 07:22:55 UTC

[GitHub] [doris] zhannngchen opened a new pull request, #11001: [enhancement](be) remove useless lock usage

zhannngchen opened a new pull request, #11001:
URL: https://github.com/apache/doris/pull/11001

   # Proposed changes
   
   Issue Number: close #xxx
   
   ## Problem Summary:
   
   Acquiring a write lock on TabletMeta's `_meta_lock` here is meaningless, since `_rs_metas` and `_stale_rs_metas` is protected by the `_meta_lock` of Tablet.
   Using of this lock is confusing here, so we'd better to remove it.
   
   ## Checklist(Required)
   
   1. Does it affect the original behavior: (Yes/No/I Don't know)
   2. Has unit tests been added: (Yes/No/No Need)
   3. Has document been added or modified: (Yes/No/No Need)
   4. Does it need to update dependencies: (Yes/No)
   5. Are there any changes that cannot be rolled back: (Yes/No)
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] github-actions[bot] commented on pull request #11001: [enhancement](be) remove useless lock usage

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #11001:
URL: https://github.com/apache/doris/pull/11001#issuecomment-1384686304

   We're closing this PR because it hasn't been updated in a while.
   This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
   If you'd like to revive this PR, please reopen it and feel free a maintainer to remove the Stale tag!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] github-actions[bot] closed pull request #11001: [enhancement](be) remove useless lock usage

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed pull request #11001: [enhancement](be) remove useless lock usage
URL: https://github.com/apache/doris/pull/11001


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] zhannngchen commented on a diff in pull request #11001: [enhancement](be) remove useless lock usage

Posted by GitBox <gi...@apache.org>.
zhannngchen commented on code in PR #11001:
URL: https://github.com/apache/doris/pull/11001#discussion_r924149389


##########
be/src/olap/tablet_meta.cpp:
##########
@@ -636,7 +636,6 @@ void TabletMeta::modify_rs_metas(const std::vector<RowsetMetaSharedPtr>& to_add,
 // an existing tablet before. Add after revise, only the passing "rs_metas"
 // is needed.
 void TabletMeta::revise_rs_metas(std::vector<RowsetMetaSharedPtr>&& rs_metas) {
-    std::lock_guard<std::shared_mutex> wrlock(_meta_lock);

Review Comment:
   Acquiring a write lock on TabletMeta's `_meta_lock` here is meaningless, since `_rs_metas` and `_stale_rs_metas` is protected by the `_meta_lock` of Tablet.
   Using of this lock is confusing here, so we'd better to remove it.
   @yiguolei @morningman could you help to check it again?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] yiguolei commented on a diff in pull request #11001: [enhancement](be) remove useless lock usage

Posted by GitBox <gi...@apache.org>.
yiguolei commented on code in PR #11001:
URL: https://github.com/apache/doris/pull/11001#discussion_r925470048


##########
be/src/olap/tablet_meta.cpp:
##########
@@ -636,7 +636,6 @@ void TabletMeta::modify_rs_metas(const std::vector<RowsetMetaSharedPtr>& to_add,
 // an existing tablet before. Add after revise, only the passing "rs_metas"
 // is needed.
 void TabletMeta::revise_rs_metas(std::vector<RowsetMetaSharedPtr>&& rs_metas) {
-    std::lock_guard<std::shared_mutex> wrlock(_meta_lock);

Review Comment:
   I am not sure, but I think we'd better not merge this PR. 
   These code is written by me. I will think about it why I use two locks here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org