-
Notifications
You must be signed in to change notification settings - Fork 632
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
Reduces flushes during commit/checkout #1381
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -403,7 +403,8 @@ def commit(self, message: Optional[str] = None) -> None: | |
str: the commit id of the stored commit that can be used to access the snapshot. | ||
""" | ||
commit_id = self.version_state["commit_id"] | ||
try_flushing(self) | ||
initial_autoflush = self.storage.autoflush | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. always disable autoflush during commit and enable it back at the end if required |
||
self.storage.autoflush = False | ||
commit(self.version_state, self.storage, message) | ||
self._info = None | ||
|
||
|
@@ -413,6 +414,7 @@ def commit(self, message: Optional[str] = None) -> None: | |
parameters={}, | ||
) | ||
|
||
self.storage.autoflush = initial_autoflush | ||
return commit_id | ||
|
||
def checkout(self, address: str, create: bool = False) -> str: | ||
|
@@ -426,7 +428,8 @@ def checkout(self, address: str, create: bool = False) -> str: | |
Returns: | ||
str: The commit_id of the dataset after checkout. | ||
""" | ||
try_flushing(self) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we can remove this call as we flush during copy_metas during checkout in version_control.py if a new branch is being created, otherwise if we're checking out to an existing branch/commit, explicit flushes have been added now. |
||
initial_autoflush = self.storage.autoflush | ||
self.storage.autoflush = False | ||
checkout(self.version_state, self.storage, address, create) | ||
self._info = None | ||
|
||
|
@@ -436,6 +439,7 @@ def checkout(self, address: str, create: bool = False) -> str: | |
parameters={"Create": str(create)}, | ||
) | ||
|
||
self.storage.autoflush = initial_autoflush | ||
return self.version_state["commit_id"] | ||
|
||
def log(self): | ||
|
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.
we already flush after copying metas inside commit function in version_control.py so this wasn't needed