Jie Yu created MESOS-1014:
-----------------------------

             Summary: Log truncation takes a long time during catch-up if the 
initial position is very large
                 Key: MESOS-1014
                 URL: https://issues.apache.org/jira/browse/MESOS-1014
             Project: Mesos
          Issue Type: Bug
    Affects Versions: 0.18.0
            Reporter: Jie Yu
             Fix For: 0.19.0


in src/log/leveldb.cpp

The while loop takes a long time if action.truncate().to() is very large.

{noformat}
Try<Nothing> LevelDBStorage::persist(const Action& action)
{
   ...
       leveldb::WriteBatch batch;

       // Add positions up to (but excluding) the truncate position to
       // the batch starting at the first position still in leveldb.
       uint64_t index = 0;
       while ((first + index) < action.truncate().to()) {
          batch.Delete(encode(first + index));
          index++;
       }
  ...
}
{noformat}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to