"key ... not in nodes" error on incremental commits
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar Fast Import |
New
|
Undecided
|
Unassigned |
Bug Description
I've been having some issues with testing of incremental commits in fast-import. My sync script is doing this:
#!/bin/sh
BASELINE=2335
REPOPATH=
bzr pull $REPOPATH/eee
bzr fast-export --baseline -r ${BASELINE}.. $REPOPATH/eee \
| bzr fast-import-filter \
(lots of redacted "-x" arguments here)
bzr fast-import 3.0_preview.fi 3.0_preview
This works for the initial import, and it _sometimes_ works for updates. Very often, though, I get an error like this:
12:10:45 Starting import of 622 commits ...
12:10:46 Found 538 commits already loaded - skipping over these ...
ABORT: exception occurred processing commit :540
bzr: ERROR: exceptions.
Traceback (most recent call last):
File "/usr/lib64/
return the_callable(*args, **kwargs)
File "/usr/lib64/
ret = run(*run_argv)
File "/usr/lib64/
return self.run(
File "/usr/lib64/
return self._operation
File "/usr/lib64/
self.cleanups, self.func, *args, **kwargs)
File "/usr/lib64/
result = func(*args, **kwargs)
File "/home/
user_
File "/home/
return proc.process(
File "/home/
super(
File "/home/
handler(self, cmd)
File "/home/
handler.
File "/home/
self.
File "/home/
self.
File "/home/
tree, basis_rev_id, changes):
File "/usr/lib64/
head_set = self._heads(
File "/home/
res = set(self.
File "/usr/lib64/
head_keys = self._graph.
File "_known_
KeyError: "key ('<email address hidden>',) not in nodes"
What appears to be happening is that the import is attempting to process a change which has two parents, but only one of the parents already exists in the known graph. The code path causing the failure is the "else" in this section of code in thunked_heads in revision_store.py:
384 if len(revision_ids) < 2:
385 res = set(revision_ids)
386 else:
387 res = set(self.
My quick fix which seemed to work was to test each possible head individually, and simply ignore non-existent nodes:
I don't know this code very well, though, so I suspect there's a better solution than this.
I'm trying to determine a simple reproducer, but it may just have to wait until the bzr repo I'm working with becomes public next week.
Oops, the patch broke three tests, so it's not good...