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

[occ] Implement basic multiversion store #322

Merged
merged 6 commits into from
Oct 6, 2023
Merged

Conversation

udpatil
Copy link
Contributor

@udpatil udpatil commented Oct 2, 2023

Describe your changes and provide context

This implements the multiversion with basic functionality, but still needs additional work to implement the iterator functionality and/or persisting readsets for validation

Testing performed to validate your change

Added unit tests for basic multiversion store

s.mtx.Lock()
defer s.mtx.Unlock()

keyString := conv.UnsafeBytesToStr(key)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'd prefer us to just use string casting here. If key bytes are mutated somehow the underlying map would be corrupted and would be difficult to debug

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you mean by mutated somehow? This is how cachekv currently implements the cache that maps between byte key and vals, so i would think there isnt too much risk in doing it this way?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modified to use string cast for safety btw

@udpatil udpatil requested a review from codchen October 5, 2023 15:20

keyString := string(key)
s.tryInitMultiVersionItem(keyString)
s.multiVersionMap[keyString].Delete(index, incarnation)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does something ever get removed from the multiVersionMap? (maybe when the last existing index/incarnation is deleted?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, because even "deletions" are tracked explicitly, as soon as we introduce an item for a key, that key will remain in the multiversion store map for the remainder of the block, because a later transaction may need to access that data. Once all transactions have completed processing, we can discard the multiversion map after committing to store

Copy link
Contributor

@stevenlanders stevenlanders left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (with one question about deletion)

@udpatil udpatil merged commit 4de5492 into occ-main Oct 6, 2023
@udpatil udpatil deleted the occ-multiversion-store branch October 6, 2023 02:18
udpatil added a commit that referenced this pull request Oct 17, 2023
## Describe your changes and provide context
This implements the multiversion with basic functionality, but still
needs additional work to implement the iterator functionality and/or
persisting readsets for validation

## Testing performed to validate your change
Added unit tests for basic multiversion store
udpatil added a commit that referenced this pull request Oct 17, 2023
## Describe your changes and provide context
This implements the multiversion with basic functionality, but still
needs additional work to implement the iterator functionality and/or
persisting readsets for validation

## Testing performed to validate your change
Added unit tests for basic multiversion store
udpatil added a commit that referenced this pull request Oct 17, 2023
## Describe your changes and provide context
This implements the multiversion with basic functionality, but still
needs additional work to implement the iterator functionality and/or
persisting readsets for validation

## Testing performed to validate your change
Added unit tests for basic multiversion store
udpatil added a commit that referenced this pull request Jan 2, 2024
## Describe your changes and provide context
This implements the multiversion with basic functionality, but still
needs additional work to implement the iterator functionality and/or
persisting readsets for validation

## Testing performed to validate your change
Added unit tests for basic multiversion store
udpatil added a commit that referenced this pull request Jan 8, 2024
## Describe your changes and provide context
This implements the multiversion with basic functionality, but still
needs additional work to implement the iterator functionality and/or
persisting readsets for validation

## Testing performed to validate your change
Added unit tests for basic multiversion store
udpatil added a commit that referenced this pull request Jan 18, 2024
## Describe your changes and provide context
This implements the multiversion with basic functionality, but still
needs additional work to implement the iterator functionality and/or
persisting readsets for validation

## Testing performed to validate your change
Added unit tests for basic multiversion store
udpatil added a commit that referenced this pull request Jan 18, 2024
## Describe your changes and provide context
This implements the multiversion with basic functionality, but still
needs additional work to implement the iterator functionality and/or
persisting readsets for validation

## Testing performed to validate your change
Added unit tests for basic multiversion store
udpatil added a commit that referenced this pull request Jan 25, 2024
## Describe your changes and provide context
This implements the multiversion with basic functionality, but still
needs additional work to implement the iterator functionality and/or
persisting readsets for validation

## Testing performed to validate your change
Added unit tests for basic multiversion store
udpatil added a commit that referenced this pull request Jan 31, 2024
## Describe your changes and provide context
This implements the multiversion with basic functionality, but still
needs additional work to implement the iterator functionality and/or
persisting readsets for validation

## Testing performed to validate your change
Added unit tests for basic multiversion store
codchen pushed a commit that referenced this pull request Feb 6, 2024
## Describe your changes and provide context
This implements the multiversion with basic functionality, but still
needs additional work to implement the iterator functionality and/or
persisting readsets for validation

## Testing performed to validate your change
Added unit tests for basic multiversion store
udpatil added a commit that referenced this pull request Feb 27, 2024
## Describe your changes and provide context
This implements the multiversion with basic functionality, but still
needs additional work to implement the iterator functionality and/or
persisting readsets for validation

## Testing performed to validate your change
Added unit tests for basic multiversion store
udpatil added a commit that referenced this pull request Mar 1, 2024
## Describe your changes and provide context
This implements the multiversion with basic functionality, but still
needs additional work to implement the iterator functionality and/or
persisting readsets for validation

## Testing performed to validate your change
Added unit tests for basic multiversion store
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

Successfully merging this pull request may close these issues.

3 participants