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

[BUG REPORT] Transaction registers closes early #185

Open
1 of 3 tasks
hhsecond opened this issue Mar 8, 2020 · 2 comments
Open
1 of 3 tasks

[BUG REPORT] Transaction registers closes early #185

hhsecond opened this issue Mar 8, 2020 · 2 comments
Labels
Bug: Priority 1 ANY chance of data/record corruption or loss.

Comments

@hhsecond
Copy link
Member

hhsecond commented Mar 8, 2020

Describe the bug
In case of multiple columns, if we open only few of such columns in context manager and still tries to write on other columns inside the context manager, transactions get False. A sample script to reproduce is given below

Severity

Select an option:

  • Data Corruption / Loss of Any Kind
  • Unexpected Behavior, Exceptions or Error Thrown
  • Performance Bottleneck

To Reproduce

from hangar import Repository
import numpy as np


repo = Repository('.')
repo.init(user_name='me', user_email='[email protected]', remove_old=True)
co = repo.checkout(write=True)
co.add_ndarray_column('x', prototype=np.array([1]))
co.add_ndarray_column('y', prototype=np.array([1]))
co.commit('added columns')
co.close()

co = repo.checkout(write=True)
x = co.columns['x']
y = co.columns['y']


with x:  # note that we are opening only `x` in the CM
    for i in range(10):
        y[i] = np.array([i])  # but we are trying to update `y` column
        x[i] = np.array([i])
co.commit('adding file')
co.close()

Desktop (please complete the following information):

  • OS: Ubuntu 19.10
  • Python: 3.7
  • Hangar: 0.5.1.dev0 (master, at the time of writing)
@rlizzo
Copy link
Member

rlizzo commented Mar 8, 2020

Thanks for the report! I'll dig in asap

@rlizzo rlizzo added Bug: Priority 1 ANY chance of data/record corruption or loss. and removed Bug: Awaiting Priority Assignment labels Mar 8, 2020
@hhsecond
Copy link
Member Author

hhsecond commented Mar 8, 2020

Sure, I tried to spend some time but happy to take another look in a bit, in case you are tied up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: Priority 1 ANY chance of data/record corruption or loss.
Projects
None yet
Development

No branches or pull requests

2 participants