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

rose.Get panil #302

Closed
EternalHunters opened this issue Feb 20, 2024 · 10 comments
Closed

rose.Get panil #302

EternalHunters opened this issue Feb 20, 2024 · 10 comments

Comments

@EternalHunters
Copy link

I think a nil check should be added

problem code:

func (it *item) Less(bi btree.Item) bool {
	return bytes.Compare(it.key, bi.(*item).key) < 0
}

trace stack:

panic: interface conversion: btree.Item is nil, not *index.item

goroutine 45976651194 [running]:
github.com/rosedblabs/rosedb/v2/index.(*item).Less(0xc03a835ec0, {0x0, 0x0})
        /data/go/pkg/mod/github.com/rosedblabs/rosedb/v2@v2.3.4/index/btree.go:31 +0xd5
github.com/google/btree.glob..func1({0x1a79740, 0xc03a835ec0}, {0x0, 0x0})
        /data/go/pkg/mod/github.com/google/btree@v1.1.2/btree_generic.go:905 +0x49
github.com/google/btree.items[...].find.func1()
        /data/go/pkg/mod/github.com/google/btree@v1.1.2/btree_generic.go:216 +0xa9
sort.Search(0x3b, 0xc00db4f268)
        /data/jenkins/tools/org.jenkinsci.plugins.golang.GolangInstallation/Go1.20.5/src/sort/search.go:65 +0x65
github.com/google/btree.items[...].find(0x1a8b860, {0x1a79740, 0xc03a835ec0}, 0x19efb88)
        /data/go/pkg/mod/github.com/google/btree@v1.1.2/btree_generic.go:215 +0x15b
github.com/google/btree.(*node[...]).get(0x1aa1e80, {0x1a79740, 0xc03a835ec0})
        /data/go/pkg/mod/github.com/google/btree@v1.1.2/btree_generic.go:322 +0xdc
github.com/google/btree.(*node[...]).get(0x1aa1e80, {0x1a79740, 0xc03a835ec0})
        /data/go/pkg/mod/github.com/google/btree@v1.1.2/btree_generic.go:326 +0x1f3
github.com/google/btree.(*node[...]).get(0x1aa1e80, {0x1a79740, 0xc03a835ec0})
        /data/go/pkg/mod/github.com/google/btree@v1.1.2/btree_generic.go:326 +0x1f3
github.com/google/btree.(*BTreeG[...]).Get(0x1aa1bc0, {0x1a79740, 0xc03a835ec0})
        /data/go/pkg/mod/github.com/google/btree@v1.1.2/btree_generic.go:824 +0x99
github.com/google/btree.(*BTree).Get(0xc018bd5860, {0x1a79740, 0xc03a835ec0})
        /data/go/pkg/mod/github.com/google/btree@v1.1.2/btree_generic.go:977 +0x5a
github.com/rosedblabs/rosedb/v2/index.(*MemoryBTree).Get(0xc00501aec0, {0xc03adf5578, 0x12, 0x18})
        /data/go/pkg/mod/github.com/rosedblabs/rosedb/v2@v2.3.4/index/btree.go:46 +0xe6
github.com/rosedblabs/rosedb/v2.(*Batch).Get(0xc0485fede0, {0xc03adf5578, 0x12, 0x18})
        /data/go/pkg/mod/github.com/rosedblabs/rosedb/v2@v2.3.4/batch.go:207 +0x3b8
@roseduan
Copy link
Collaborator

Thanks, how to reproduce the problem?

@EternalHunters
Copy link
Author

Thanks, how to reproduce the problem?

sorry, i don't know how to reproduce,I only encountered it in the prod environment, and I haven’t found the data scenario yet.

@roseduan
Copy link
Collaborator

Thanks, how to reproduce the problem?

sorry, i don't know how to reproduce,I only encountered it in the prod environment, and I haven’t found the data scenario yet.

Thanks for your feedback. I will fix this by adding a nil check.

@EternalHunters
Copy link
Author

Thanks, how to reproduce the problem?

sorry, i don't know how to reproduce,I only encountered it in the prod environment, and I haven’t found the data scenario yet.

Thanks for your feedback. I will fix this by adding a nil check.

Is there an estimated repair time?

@roseduan
Copy link
Collaborator

roseduan commented Mar 3, 2024

Thanks, how to reproduce the problem?

sorry, i don't know how to reproduce,I only encountered it in the prod environment, and I haven’t found the data scenario yet.

Thanks for your feedback. I will fix this by adding a nil check.

Is there an estimated repair time?

https://github.com/rosedblabs/rosedb/releases/tag/v2.3.5
Fixed in the latest release.

@EternalHunters
Copy link
Author

Thanks, how to reproduce the problem?

sorry, i don't know how to reproduce,I only encountered it in the prod environment, and I haven’t found the data scenario yet.

Thanks for your feedback. I will fix this by adding a nil check.

Is there an estimated repair time?

https://github.com/rosedblabs/rosedb/releases/tag/v2.3.5 Fixed in the latest release.
When you have time, you can take a look at the scenarios in which this problem occurs.

@EternalHunters
Copy link
Author

Thanks, how to reproduce the problem?

sorry, i don't know how to reproduce,I only encountered it in the prod environment, and I haven’t found the data scenario yet.

Thanks for your feedback. I will fix this by adding a nil check.

Is there an estimated repair time?

https://github.com/rosedblabs/rosedb/releases/tag/v2.3.5 Fixed in the latest release.

image after update still panic

@EternalHunters
Copy link
Author

Uploading Xnip2024-03-06_10-11-59.jpg…

@roseduan
Copy link
Collaborator

roseduan commented Mar 6, 2024

Can you give me an example code to reproduce the problem?

@roseduan
Copy link
Collaborator

Are you still having problems with this issue? @EternalHunters

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