facebook / facebook/rocksdb

The content of the read record records changes in the wal iterator

Open
#9,965 0 comments 0 reactions 0 assignees View on GitHub
question up-for-grabs
Dominant language
C++
Stars
32.1k
Forks
6.9k
Avg merge
32m
Merged PRs (30d)
1

Description

### version
6.10.1

### Problem Description
```
rocksdb::TransactionLogIteratorImpl::Valid (this=0x7f7804937000) at db/transaction_log_impl.cc:80
80 bool TransactionLogIteratorImpl::Valid() { return started_ && is_valid_; }
(gdb) p *current_batch_
Python Exception There is no member or method named _M_head_impl.:
$52 = (rocksdb::WriteBatch &) @0x7f78048274b0: { = {_vptr.WriteBatchBase = 0x11ee598 }, save_points_ = , wal_term_point_ = {size = 0,
count = 0, content_flags = 0}, content_flags_ = {> = {static _S_alignment = 4, _M_i = 1}, }, max_bytes_ = 0, is_latest_persistent_state_ = false,
rep_ = "\002\000\000\000\000\000\000\000\001\000\000\000\001\367\005\064\223_\004\001\271xxxxx-hash-test-86400:userId:5727e6225e87e771c1deeeee***-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ12345678"..., timestamp_size_ = 0}
(gdb) f
#0 rocksdb::TransactionLogIteratorImpl::Valid (this=0x7f7804937000) at db/transaction_log_impl.cc:80
80 bool TransactionLogIteratorImpl::Valid() { return started_ && is_valid_; }
(gdb) p started_
$53 = true
(gdb) p is_valid_
$54 = true
(gdb) n
rocksdb_wal_iter_valid (iter=0x7f7804805010) at db/c.cc:1079
1079 }
(gdb) n
get_updates_since (ptr_wal_iter=0x7f7802e2e070, seq_num=seq_num@entry=0x7f78055fcc70, last_seq_num=last_seq_num@entry=2, updates=updates@entry=0x7f7804838e80,
update_max_count=update_max_count@entry=100000, update_idx=update_idx@entry=0x7f78055fcc6c, log_disappered=0x7f78055fcc6a) at ./flash/storage/rocksdb.cpp:1331
1331 uint64_t batchMinSeq = 0;
(gdb) n
1332 serverLog(LL_WARNING, "xxx 666 *ptr:%x", *ptr_wal_iter);
(gdb) n
1333 write_batch = rocksdb_wal_iter_get_batch (*ptr_wal_iter, &batchMinSeq);
(gdb) s
rocksdb_wal_iter_get_batch (iter=0x7f7804805010, seq=0x7f78055fcbe0) at db/c.cc:1091
1091 rocksdb_writebatch_t* result = rocksdb_writebatch_create();
(gdb) n
1092 BatchResult wal_batch = iter->rep->GetBatch();
(gdb) s
rocksdb::TransactionLogIteratorImpl::GetBatch (this=0x7f7804937000) at db/transaction_log_impl.cc:71
71 assert(is_valid_); // cannot call in a non valid state.
(gdb) p is_valid_
$55 = true
(gdb) p started_
$56 = true
(gdb) p *current_batch_
Python Exception There is no member or method named _M_head_impl.:
$57 = (rocksdb::WriteBatch &) @0x7f78048274b0: { = {_vptr.WriteBatchBase = 0x11ee598 }, save_points_ = , wal_term_point_ = {size = 0,
count = 0, content_flags = 0}, content_flags_ = {> = {static _S_alignment = 4, _M_i = 0}, }, max_bytes_ = 0, is_latest_persistent_state_ = false,
rep_ = '\000' , timestamp_size_ = 0}
```
Why is the current_batch_ in the wal iterator printed twice, its **rep** content changed, what happened?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.