-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Enforce Editor Lock for Write, Append, and Upload Operations in DataNode #2122
base: develop
Are you sure you want to change the base?
Conversation
Hey, @FlorianJacta and @bobbyshermi |
if self.id not in in_memory_storage: | ||
in_memory_storage[self.id] = [] | ||
|
||
in_memory_storage[self.id].append(data) # Append new data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the previous data of the data node has no append
method.
In other words, what if in_memory_storage[self.id]
has no append
method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I added a if instance condition to resolve that. Please review it and let me know if any changes required.
PR Description
Title: Enforce Editor Lock for Write, Append, and Upload Operations in DataNode
Summary
This PR addresses the issue #2017 where a
DataNode
could be modified by other editors despite being locked by one. It ensures that once aDataNode
is locked with aneditor_id
, no other editor can perform write, append, or upload operations until the lock is released.Changes Implemented
write()
,append()
, and_upload()
methods:DataNodeIsBeingEdited
exception when a different editor attempts to modify the lockedDataNode
.editor_id
even during an active lock.test_data_node.py
to validate the new behavior.Acceptance Criteria Met
editor_id
.This PR ensures consistent locking behavior across all relevant operations in line with the documentation and expected usage.