rebase fails due to InconsistentDelta error

Bug #1100385 reported by Brian de Alwis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
New
Undecided
Unassigned

Bug Description

I'm trying to use bzr-rewrite to rebase a sizable branch against another sizable branch which is failing:

$ bzr rebase ../upstream
InconsistentDelta: An inconsistent delta was supplied involving 'plugins/com.lgc.dsp-app/test/com/lgc/dspapp/Unit.java', 'unit.java-20121220111703-t043mg4ricop7icj-3'
reason: Unable to find block for this record. Was the parent added?

Both branches have an empty directory, and one of the upstream revisions adds a new file to that directory.

I've been able to reproduce this in a small example:

    [/tmp]$ bzr init upstream
    Created a standalone tree (format: 2a)
    [/tmp]$ cd upstream
    [/tmp/upstream]$ bzr mkdir dir
    added dir
    [/tmp/upstream]$ echo rev1 > file
    [/tmp/upstream]$ bzr add file
    adding file
    [/tmp/upstream]$ bzr commit -m 'First'
    Committing to: /private/tmp/upstream/
    added dir
    added file
    Committed revision 1.
    [/tmp/upstream]$ bzr branch . ../other
    Branched 1 revision.
    [/tmp/upstream]$ echo rev2 > dir/file
    [/tmp/upstream]$ bzr add dir
    adding dir/file
    [/tmp/upstream]$ bzr commit -m 'Second'
    Committing to: /private/tmp/upstream/
    added dir/file
    Committed revision 2.
    [/tmp/upstream]$ cd ../other
    [/tmp/other]$ echo 'alternate' >
    .bzr/ dir/ file
    [/tmp/other]$ echo 'alternate' > file
    [/tmp/other]$ bzr commit -m 'Alternative 2nd'
    Committing to: /private/tmp/other/
    modified file
    Committed revision 2.
    [/tmp/other]$ bzr rebase ../upstream
    bzr: ERROR: An inconsistent delta was supplied involving 'dir/file', 'file-20130116170606-9odv6d1bgevoz5rc-1'
    reason: Unable to find block for this record. Was the parent added?

The problem seems to be in DirState._update_basis_apply_adds() as the DirState's_dirblocks doesn't have an entry for "dir" since there is no file content:

           dirname, basename = osutils.split(new_path)
            entry_key = st(dirname, basename, file_id)
            block_index, present = self._find_block_index_from_key(entry_key)
            if not present:
                self._raise_invalid(new_path, file_id,
                    "Unable to find block for this record."
                    " Was the parent added?")

which needs to instead insert appropriate entries.

Related branches

Revision history for this message
Brian de Alwis (slyguy) wrote :
Download full text (4.8 KiB)

Oops: here's the .bzr.log:

Wed 2013-01-16 12:06:54 -0500
0.044 bazaar version: 2.6b2
0.045 bzr arguments: [u'rebase', u'../a']
0.048 looking for plugins in /Users/bsd/.bazaar/plugins
0.074 Deprecated function called
Called from:
  File "/usr/pkg/lib/python2.7/site-packages/bzrlib/plugin.py", line 382, in _load_plugin_module
    exec "import bzrlib.plugins.%s" % name in {}
  File "<string>", line 1, in <module>
  File "/Users/bsd/.bazaar/plugins/keywords/__init__.py", line 386, in <module>
    filters.register_filter_stack_map('keywords', _keywords_filter_stack_lookup)
  File "/usr/pkg/lib/python2.7/site-packages/bzrlib/symbol_versioning.py", line 100, in decorated_function
    trace.mutter_callsite(4, "Deprecated function called")
0.089 looking for plugins in /usr/pkg/lib/python2.7/site-packages/bzrlib/plugins
0.089 Plugin name bash_completion already loaded
0.089 Plugin name git already loaded
0.099 encoding stdout as sys.stdout encoding 'UTF-8'
0.120 opening working tree '/private/tmp/b'
0.133 Using fetch logic to copy between CHKInventoryRepository('file:///private/tmp/a/.bzr/repository/')(RepositoryFormat2a()) and CHKInventoryRepository('file:///private/tmp/b/.bzr/repository/')(RepositoryFormat2a())
0.135 fetching: <SearchResult search:(set(['<email address hidden>']), set(['<email address hidden>', 'null:']), 1)>
0.157 Using fetch logic to copy between CHKInventoryRepository('file:///private/tmp/a/.bzr/repository/')(RepositoryFormat2a()) and CHKInventoryRepository('file:///private/tmp/b/.bzr/repository/')(RepositoryFormat2a())
0.157 fetching: <SearchResult search:(set(['<email address hidden>']), set(['<email address hidden>', 'null:', '<email address hidden>']), 0)>
0.158 Started 2 unique searchers for 2 unique revisions
0.166 Not saving DirState because _changes_aborted is set.
0.167 Transferred: 0kB (0.0kB/s r:0kB w:0kB)
0.176 Traceback (most recent call last):
  File "/usr/pkg/lib/python2.7/site-packages/bzrlib/commands.py", line 930, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/pkg/lib/python2.7/site-packages/bzrlib/commands.py", line 1141, in run_bzr
    ret = run(*run_argv)
  File "/usr/pkg/lib/python2.7/site-packages/bzrlib/commands.py", line 673, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/pkg/lib/python2.7/site-packages/bzrlib/commands.py", line 697, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/pkg/lib/python2.7/site-packages/bzrlib/cleanup.py", line 136, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/pkg/lib/python2.7/site-packages/bzrlib/cleanup.py", line 166, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/pkg/lib/python2.7/site-packages/bzrlib/commands.py", line 1158, in ignore_pipe
    result = func(*args, **kwargs)
  File "/Users/bsd/.bazaar/plugins/rewrite/commands.py", line 227, in run
    finish_rebase(state, wt, replace_map, replayer)
  File "/Users/bsd/.bazaar/plugins/rewrite/commands.py", line 48, in finish_rebase
    rebase(wt.branch.repository, replace_map...

Read more...

Revision history for this message
Brian de Alwis (slyguy) wrote :

I've attached a fix that works locally and my local tests pass (barring failures due to 'compiled extensions could not be loaded').

tags: added: inconsistentdelta
Jelmer Vernooij (jelmer)
affects: bzr → bzr-rewrite
Revision history for this message
Brian de Alwis (slyguy) wrote : Re: [Bug 1100385] Re: rebase fails due to InconsistentDelta error

FYI Jelmer: the problem is actually in bzr — it's just tickled by bzr-rewrite

On 2013-01-16, at 8:03 PM, Jelmer Vernooij <email address hidden> wrote:

> ** Project changed: bzr => bzr-rewrite
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1100385
>
> Title:
> rebase fails due to InconsistentDelta error
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/bzr-rewrite/+bug/1100385/+subscriptions

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Hi Brian,

I think it's caused by the way bzr-rewrite calls out to the bzr API. But I haven't checked in detail.

Revision history for this message
Brian de Alwis (slyguy) wrote :

Jelmer, I'm 99.9% certain that it's not bzr-rewrite — it has the same symptoms as bug 855155 and my patch to bzr fixes the issues described in that bug.

Jelmer Vernooij (jelmer)
affects: bzr-rewrite → bzr
Revision history for this message
GuilhemBichot (guilhem-bichot) wrote :

seeing the same error in MySQL when using rebase.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.