Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] RecordPageHandler initialize failed after observer restart. #279

Open
Double0101 opened this issue Oct 4, 2023 · 3 comments
Open
Labels
bug Something isn't working

Comments

@Double0101
Copy link
Contributor

Create a table and insert some rows, then stop observer.

➜  build ✗ ./bin/obclient -s miniob.sock
miniob > create table just_a_test (id int, id2 int);
SUCCESS
miniob > insert into just_a_test values (1, 1);
SUCCESS
miniob > insert into just_a_test values (2,2);
SUCCESS
miniob > exit
--- 
### then stop observer
➜  build ✗ ./bin/obclient -s miniob.sock
miniob > select * from just_a_test;
id | id2

Restart observer, then select from the table created before. It return no record.
RecordPageHandler will be nullptr and record_page_iterator_ is invalid.

RC RecordFileScanner::fetch_next_record()
{
  RC rc = RC::SUCCESS;
  if (record_page_iterator_.is_valid()) {
    // 当前页面还是有效的,尝试看一下是否有有效记录
    rc = fetch_next_record_in_page();
  .......
}
@Double0101 Double0101 added the bug Something isn't working label Oct 4, 2023
@hnwyllmm
Copy link
Collaborator

hnwyllmm commented Oct 7, 2023

How did you startup the observer?

@Double0101
Copy link
Contributor Author

./observer -s ../miniob.sock -f ../../etc/observer.ini

@hnwyllmm
Copy link
Collaborator

hnwyllmm commented Oct 8, 2023

Currently, MiniOB doesn't support durability and if you stop the observer, the data maybe lost. But this issue will be fixed in the future.
You can use sync command to dump the data in the memory into disk now.

hnwyllmm added a commit that referenced this issue Apr 28, 2024
### What problem were solved in this pull request?

Issue Number: close #118 #279 

Problem:
当前的WAL仅记录了事务的日志,没有记录内部对象,比如record manager、B+树等的日志,导致在异常重启时,可能正常无法恢复。

### What is changed and how it works?
除了记录事务日志,还记录了Buffer pool、record
manager、B+树等内部数据日志,可以保证内部对象变更后断电等异常,仍然可以通过日志来恢复数据。

另外,此PR也实现了事务的回滚日志。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants