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

Fix the wrong compare of catalog cache's mvcc #13440

Merged
merged 5 commits into from Dec 13, 2023

Conversation

nnsgmsone
Copy link
Contributor

@nnsgmsone nnsgmsone commented Dec 13, 2023

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue #https://github.com/matrixorigin/MO-Cloud/issues/2009

What this PR does / why we need it:

对于类似于以下场景:

begin;
create table t(a int);
alter table t add column `remark` varchar(100);
commit;

会出现表找不到的情况,本质原因是因为上述事务会产生以下logtail:

k0 = insert (t(name)+10(tableid) + 100(timestamp))
k1 = delete (t(name)+10(tableid) + 100(timestamp))
k2 = insert (t(name)+12(tableid) + 100(timestamp))

因为多版本k的比较代码存在如下的代码:

if a.deleted && !b.deleted { //deleted item head first
			return true
}

所以会生成k1, k2, k0类似于这样的序列,这样的情况会导致表找不到。修改为delete只比需要删除的key大来修正这个问题

@matrix-meow matrix-meow added the size/S Denotes a PR that changes [10,99] lines label Dec 13, 2023
@mergify mergify bot requested a review from sukki37 December 13, 2023 09:44
@mergify mergify bot added the kind/bug Something isn't working label Dec 13, 2023
@mergify mergify bot merged commit a6eae6c into matrixorigin:1.0-dev Dec 13, 2023
18 checks passed
@nnsgmsone nnsgmsone deleted the 1.0 branch December 26, 2023 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working size/S Denotes a PR that changes [10,99] lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants