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

nil tail when recovering existing partitions #64

Open
ekimeel opened this issue Apr 5, 2023 · 0 comments
Open

nil tail when recovering existing partitions #64

ekimeel opened this issue Apr 5, 2023 · 0 comments

Comments

@ekimeel
Copy link

ekimeel commented Apr 5, 2023

When recovering / restoring from an existing data directory the tail is nil and results in a segment fault during inserting.

I have introduced a recovery mode on my fork but as a work around, I have added the following code to getTail on partitionListImpl.

func (p *partitionListImpl) getTail() partition {
	if p.size() <= 0 {
		return nil
	}
	p.mu.RLock()
	defer p.mu.RUnlock()

	if p.tail == nil {
		log.Warn("tail partition not found, attempting to recover tail")
		i := p.newIterator()
		for i.next() {
			p.tail = i.currentNode()
		}
	}

	return p.tail.value()
}
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

1 participant