Giter Site home page Giter Site logo

[BUG]Memtable test hangs about terarkdb HOT 9 CLOSED

noobpwnftw avatar noobpwnftw commented on July 29, 2024
[BUG]Memtable test hangs

from terarkdb.

Comments (9)

royguo avatar royguo commented on July 29, 2024

Thanks for reporting this bug.

@yapple and @ustcwelcome Please have a look on this.

from terarkdb.

yapple avatar yapple commented on July 29, 2024

@noobpwnftw good question. But that's not a bug.
The Seqreadwrite bench has a least one thread to do write operation, others thread do read operation . Read thread create a read iterator to read all data, and all read threads repeat that seqread operation num_operations times. You can know that by reading the bench code.
so, the faster the write rate, the more write data, the slower the bench rate.
Terarkdb does some little engineering optimizes on Skiplist implementation, so the write Skiplist speed is faster than Rocksdb. You can test that use -num_threads 1.
In conclusion, the bench is mystified, we will refine it in the future.
Thank you for your attention.

from terarkdb.

yapple avatar yapple commented on July 29, 2024

image
image
On my machine, Terarkdb's write rate is faster than RocksDB 8.5 times(12:1.4).

from terarkdb.

noobpwnftw avatar noobpwnftw commented on July 29, 2024

For concurrent tests, you need at least 2 threads(one thread is always writer in memtablerep_bench, if -num_threads is 1, seqreadwrite test is the same as fillseq.

from terarkdb.

yapple avatar yapple commented on July 29, 2024

For concurrent tests, you need at least 2 threads(one thread is always writer in memtablerep_bench, if -num_threads is 1, seqreadwrite test is the same as fillseq.

Yes, we did the concurrent tests, and reproduce the hangs behavior.
But what I meaning is that the bench logic leads to the behavior.
the faster the write rate, the more write data, the slower the bench rate.
because TerarkDB writes so fast, so on this bench, we hang.

from terarkdb.

noobpwnftw avatar noobpwnftw commented on July 29, 2024

If it is so fast, how long does it take to write and scan 1000 record 10 times(as per given command)?

from terarkdb.

yapple avatar yapple commented on July 29, 2024
  1. The command's param num_operations means that scan all data num_operations times.
  2. the fill thread finish until the read thread finish, you can see from that code
    ConcurrentFillBenchmarkThread
    because the Skiplist supports multi versions, so the number of records will be far greater than 1000.
    so, you can't use the benchmark to test the case like that write and scan 1000 records 10 times.

from terarkdb.

yapple avatar yapple commented on July 29, 2024

@noobpwnftw
./memtablerep_bench -benchmarks fillrandom,readseq
maybe you need this command.

from terarkdb.

noobpwnftw avatar noobpwnftw commented on July 29, 2024

This issue can be fixed like this:

class ConcurrentFillBenchmarkThread : public FillBenchmarkThread {
 public:
  ConcurrentFillBenchmarkThread(MemTableRep* table, KeyGenerator* key_gen,
                                uint64_t* bytes_written, uint64_t* bytes_read,
                                uint64_t* sequence, uint64_t num_ops,
                                uint64_t* read_hits,
                                std::atomic_int* threads_done)
      : FillBenchmarkThread(table, key_gen, bytes_written, bytes_read, sequence,
                            num_ops, read_hits) {
    threads_done_ = threads_done;
  }

  void operator()() override {
-   // # of read threads will be total threads - write threads (always 1). Loop
-   // while all reads complete.
-   while ((*threads_done_).load() < (FLAGS_num_threads - 1)) {
+   for (unsigned int i = 0; i < num_ops_; ++i) {
      FillOne();
    }
  }

from terarkdb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.