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/11/21 11:14:52 UTC

[GitHub] [doris] freemandealer opened a new pull request, #14449: [Enhancement](storage) optimize segment compaction log (#14448)

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

   Signed-off-by: freemandealer <fr...@gmail.com>
   
   # Proposed changes
   
   Issue Number: close #xxx
   
   ## Problem summary
   
   Describe your changes.
   
   ## 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 (If Yes, please explain WHY)
       - [ ] 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] yiguolei merged pull request #14449: [Enhancement](storage) optimize segment compaction log (#14448)

Posted by GitBox <gi...@apache.org>.
yiguolei merged PR #14449:
URL: https://github.com/apache/doris/pull/14449


-- 
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 #14449: [Enhancement](storage) optimize segment compaction log (#14448)

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


##########
be/src/olap/rowset/beta_rowset_writer.cpp:
##########
@@ -340,16 +338,19 @@ Status BetaRowsetWriter::_do_compact_segments(SegCompactionCandidatesSharedPtr s
         for (const auto& entry : std::filesystem::directory_iterator(_context.rowset_dir)) {
             fmt::format_to(vlog_buffer, "[{}]", string(entry.path()));
         }
-        VLOG_DEBUG << "_segcompacted_point:" << _segcompacted_point
+        VLOG_DEBUG << "tablet_id:" << _context.tablet_id << " rowset_id:" << _context.rowset_id
+                   << "_segcompacted_point:" << _segcompacted_point
                    << " _num_segment:" << _num_segment << " _num_segcompacted:" << _num_segcompacted
                    << " list directory:" << fmt::to_string(vlog_buffer);
     }
 
     _segcompacted_point += (end - begin + 1);
 
     uint64_t elapsed = GetCurrentTimeMicros() - begin_time;
-    LOG(INFO) << "BetaRowsetWriter:" << this << " segcompaction completed. elapsed time:" << elapsed
-              << "us. _segcompacted_point update:" << _segcompacted_point;
+    LOG(INFO) << "segcompaction completed. tablet_id:" << _context.tablet_id

Review Comment:
   I do not think we should use fmt in log... It is very ugly. If it is required, I think it is better to add another logger, like LOG_INFO(fmt, args....);



-- 
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] freemandealer commented on a diff in pull request #14449: [Enhancement](storage) optimize segment compaction log (#14448)

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


##########
be/src/olap/rowset/beta_rowset_writer.cpp:
##########
@@ -340,16 +338,19 @@ Status BetaRowsetWriter::_do_compact_segments(SegCompactionCandidatesSharedPtr s
         for (const auto& entry : std::filesystem::directory_iterator(_context.rowset_dir)) {
             fmt::format_to(vlog_buffer, "[{}]", string(entry.path()));
         }
-        VLOG_DEBUG << "_segcompacted_point:" << _segcompacted_point
+        VLOG_DEBUG << "tablet_id:" << _context.tablet_id << " rowset_id:" << _context.rowset_id
+                   << "_segcompacted_point:" << _segcompacted_point
                    << " _num_segment:" << _num_segment << " _num_segcompacted:" << _num_segcompacted
                    << " list directory:" << fmt::to_string(vlog_buffer);
     }
 
     _segcompacted_point += (end - begin + 1);
 
     uint64_t elapsed = GetCurrentTimeMicros() - begin_time;
-    LOG(INFO) << "BetaRowsetWriter:" << this << " segcompaction completed. elapsed time:" << elapsed
-              << "us. _segcompacted_point update:" << _segcompacted_point;
+    LOG(INFO) << "segcompaction completed. tablet_id:" << _context.tablet_id

Review Comment:
   Would you mind telling why? I saw people suggesting fmt::format here in doris more than once. Is it for performance concern or just the coding style?



-- 
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] freemandealer commented on a diff in pull request #14449: [Enhancement](storage) optimize segment compaction log (#14448)

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


##########
be/src/olap/rowset/beta_rowset_writer.cpp:
##########
@@ -340,16 +338,19 @@ Status BetaRowsetWriter::_do_compact_segments(SegCompactionCandidatesSharedPtr s
         for (const auto& entry : std::filesystem::directory_iterator(_context.rowset_dir)) {
             fmt::format_to(vlog_buffer, "[{}]", string(entry.path()));
         }
-        VLOG_DEBUG << "_segcompacted_point:" << _segcompacted_point
+        VLOG_DEBUG << "tablet_id:" << _context.tablet_id << " rowset_id:" << _context.rowset_id
+                   << "_segcompacted_point:" << _segcompacted_point
                    << " _num_segment:" << _num_segment << " _num_segcompacted:" << _num_segcompacted
                    << " list directory:" << fmt::to_string(vlog_buffer);
     }
 
     _segcompacted_point += (end - begin + 1);
 
     uint64_t elapsed = GetCurrentTimeMicros() - begin_time;
-    LOG(INFO) << "BetaRowsetWriter:" << this << " segcompaction completed. elapsed time:" << elapsed
-              << "us. _segcompacted_point update:" << _segcompacted_point;
+    LOG(INFO) << "segcompaction completed. tablet_id:" << _context.tablet_id

Review Comment:
   Thanks for explanation. Now I am a little confused at when I should use which ... I will benchmark them in my spare time.



-- 
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 #14449: [Enhancement](storage) optimize segment compaction log (#14448)

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

   PR approved by anyone and no changes requested.


-- 
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 #14449: [Enhancement](storage) optimize segment compaction log (#14448)

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

   PR approved by at least one committer and no changes requested.


-- 
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] luozenglin commented on a diff in pull request #14449: [Enhancement](storage) optimize segment compaction log (#14448)

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


##########
be/src/olap/rowset/beta_rowset_writer.cpp:
##########
@@ -340,16 +338,19 @@ Status BetaRowsetWriter::_do_compact_segments(SegCompactionCandidatesSharedPtr s
         for (const auto& entry : std::filesystem::directory_iterator(_context.rowset_dir)) {
             fmt::format_to(vlog_buffer, "[{}]", string(entry.path()));
         }
-        VLOG_DEBUG << "_segcompacted_point:" << _segcompacted_point
+        VLOG_DEBUG << "tablet_id:" << _context.tablet_id << " rowset_id:" << _context.rowset_id
+                   << "_segcompacted_point:" << _segcompacted_point
                    << " _num_segment:" << _num_segment << " _num_segcompacted:" << _num_segcompacted
                    << " list directory:" << fmt::to_string(vlog_buffer);
     }
 
     _segcompacted_point += (end - begin + 1);
 
     uint64_t elapsed = GetCurrentTimeMicros() - begin_time;
-    LOG(INFO) << "BetaRowsetWriter:" << this << " segcompaction completed. elapsed time:" << elapsed
-              << "us. _segcompacted_point update:" << _segcompacted_point;
+    LOG(INFO) << "segcompaction completed. tablet_id:" << _context.tablet_id

Review Comment:
   Maybe `fmt::format` is better.



-- 
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] luozenglin commented on a diff in pull request #14449: [Enhancement](storage) optimize segment compaction log (#14448)

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


##########
be/src/olap/rowset/beta_rowset_writer.cpp:
##########
@@ -340,16 +338,19 @@ Status BetaRowsetWriter::_do_compact_segments(SegCompactionCandidatesSharedPtr s
         for (const auto& entry : std::filesystem::directory_iterator(_context.rowset_dir)) {
             fmt::format_to(vlog_buffer, "[{}]", string(entry.path()));
         }
-        VLOG_DEBUG << "_segcompacted_point:" << _segcompacted_point
+        VLOG_DEBUG << "tablet_id:" << _context.tablet_id << " rowset_id:" << _context.rowset_id
+                   << "_segcompacted_point:" << _segcompacted_point
                    << " _num_segment:" << _num_segment << " _num_segcompacted:" << _num_segcompacted
                    << " list directory:" << fmt::to_string(vlog_buffer);
     }
 
     _segcompacted_point += (end - begin + 1);
 
     uint64_t elapsed = GetCurrentTimeMicros() - begin_time;
-    LOG(INFO) << "BetaRowsetWriter:" << this << " segcompaction completed. elapsed time:" << elapsed
-              << "us. _segcompacted_point update:" << _segcompacted_point;
+    LOG(INFO) << "segcompaction completed. tablet_id:" << _context.tablet_id

Review Comment:
   Better performance, you can refer to: https://stackoverflow.com/questions/58157033/why-is-fmt-slower-than-stdstringstream



-- 
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] freemandealer commented on a diff in pull request #14449: [Enhancement](storage) optimize segment compaction log (#14448)

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


##########
be/src/olap/rowset/beta_rowset_writer.cpp:
##########
@@ -340,16 +338,19 @@ Status BetaRowsetWriter::_do_compact_segments(SegCompactionCandidatesSharedPtr s
         for (const auto& entry : std::filesystem::directory_iterator(_context.rowset_dir)) {
             fmt::format_to(vlog_buffer, "[{}]", string(entry.path()));
         }
-        VLOG_DEBUG << "_segcompacted_point:" << _segcompacted_point
+        VLOG_DEBUG << "tablet_id:" << _context.tablet_id << " rowset_id:" << _context.rowset_id
+                   << "_segcompacted_point:" << _segcompacted_point
                    << " _num_segment:" << _num_segment << " _num_segcompacted:" << _num_segcompacted
                    << " list directory:" << fmt::to_string(vlog_buffer);
     }
 
     _segcompacted_point += (end - begin + 1);
 
     uint64_t elapsed = GetCurrentTimeMicros() - begin_time;
-    LOG(INFO) << "BetaRowsetWriter:" << this << " segcompaction completed. elapsed time:" << elapsed
-              << "us. _segcompacted_point update:" << _segcompacted_point;
+    LOG(INFO) << "segcompaction completed. tablet_id:" << _context.tablet_id

Review Comment:
   Thanks for explanation. Now I am a little confused at when I should use which ... maybe I should benchmark them some day



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