imay commented on a change in pull request #1400: Acquire rs readers at the 
beginning of the olapscanner
URL: https://github.com/apache/incubator-doris/pull/1400#discussion_r298015789
 
 

 ##########
 File path: be/src/exec/olap_scanner.cpp
 ##########
 @@ -150,6 +150,20 @@ Status OlapScanner::_init_params(
     _params.aggregation = _aggregation;
     _params.version = Version(0, _version);
 
+    // acquire tablet rowset readers at the beginning of the scan node 
+    // to prevent this case: when there are lots of olap scanners to run for 
example 10000
+    // the rowsets maybe compacted when the last olap scanner starts
+    _tablet->obtain_header_rdlock();
+    OLAPStatus acquire_reader_st = 
_tablet->capture_rs_readers(_params.version, &_params.rs_readers);
+    _tablet->release_header_lock();
 
 Review comment:
   I think you should add a function in tablet who will encapsulate the lock 
and unlock operation.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to