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

There may be a bug in your code in heapfile.java #11

Open
Handora opened this issue Jan 30, 2018 · 2 comments
Open

There may be a bug in your code in heapfile.java #11

Handora opened this issue Jan 30, 2018 · 2 comments

Comments

@Handora
Copy link

Handora commented Jan 30, 2018

Here is the case that you write a new page through insertTuple, you just write the page into your file through writePage. And if the transaction aborts, the page will be still inserted into your file. I have faced this question too, and don't have a graceful solution.(I just add some clauses)

@Handora
Copy link
Author

Handora commented Jan 31, 2018

I come up with an idea, you should put the this.writePage(newPage); before newPage.insertTuple(tuple);. Which left the file to have a new empty page while left the dirty one in the bufferpool. So the rollback can work successfully.

@jasonleaster
Copy link
Owner

After you finished lab6, you will know that there have recovery and rollback mechanism. That't won't be problem. When transaction abort, a "ABORT" record will be written into "log file" and this file will know how to recovery.

I have updated my solution, check it. TransactionTest of system has been passed and others unit test also works well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants