-
Notifications
You must be signed in to change notification settings - Fork 346
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
Can't address a revision by change id #924
Comments
Nah, but the undiscoverable revision is
diff --git a/lib/src/revset.rs b/lib/src/revset.rs
index 12245cab44...ef9ed47765 100644
--- a/lib/src/revset.rs
+++ b/lib/src/revset.rs
@@ -124,6 +124,12 @@
// TODO: Create a persistent lookup from change id to (visible?) commit ids.
for index_entry in RevsetExpression::all().evaluate(repo, None).unwrap().iter() {
let change_id = index_entry.change_id();
+ let commit = repo.store().get_commit(&index_entry.commit_id()).unwrap();
+ eprintln!(
+ "{change_id:?}, {change_id2:?}, {commit_id:?}",
+ change_id2 = commit.change_id(),
+ commit_id = index_entry.commit_id()
+ );
if change_id.hex().starts_with(hex_prefix.hex()) {
if let Some(previous_change_id) = found_change_id.replace(change_id.clone()) {
if previous_change_id != change_id { |
I think that repo may be old (pre-thrift) but did not go through the
downgrade to thrift and subsequent upgrade back to protobuf. Maybe this
causes the new jj to use different change ids for the same commits or
something.
…On Tue, Dec 20, 2022, 7:09 PM Yuya Nishihara ***@***.***> wrote:
might this have to do with some of your recent changes to change id
resolution?
Nah, but the undiscoverable revision is entry.change_id() !=
store.get_commit(entry.commit_id()).change_id().
Maybe you have multiple change ids somehow associated with a single git
commit? @martinvonz <https://github.com/martinvonz>?
ChangeId("164f07b0822b426684cd355a67983c1d"), ChangeId("164f07b0822b426684cd355a67983c1d"), CommitId("0595387ef76f59a7138f1abc890f4bc1117b33b5")
ChangeId("978ce5729598410d9b1bd3e87ee0d262"), ChangeId("978ce5729598410d9b1bd3e87ee0d262"), CommitId("a133a9cdf92e27761a9818811cbe1f740c1b9dc9")
ChangeId("b79ef7a3dc1f849ea06ba57060ee258d"), ChangeId("b79ef7a3dc1f849ea06ba57060ee258d"), CommitId("f879344257856759d78ab908c00b3a03522addcf")
ChangeId("f518cdb60c14a52174e19e7aba02d65c"), ChangeId("f518cdb60c14a52174e19e7aba02d65c"), CommitId("b7ea512ff67d0577ccddcafbf5861a06bc862bff")
ChangeId("45b3b056842d45a273932590b227dd79"), ChangeId("45b3b056842d45a273932590b227dd79"), CommitId("888b4666d83382c3c06811ba6b5c8fc39a3f8cd1")
ChangeId("b99e18206ec470cca650a6b4cab138a7"), ChangeId("d9deb76cecc7350e75b9a7a88349242e"), CommitId("87e04ac3742492c115e59dae70ace33736ed7b9b")
...
diff --git a/lib/src/revset.rs b/lib/src/revset.rs
index 12245cab44...ef9ed47765 100644--- a/lib/src/revset.rs+++ b/lib/src/revset.rs@@ -124,6 +124,12 @@
// TODO: Create a persistent lookup from change id to (visible?) commit ids.
for index_entry in RevsetExpression::all().evaluate(repo, None).unwrap().iter() {
let change_id = index_entry.change_id();+ let commit = repo.store().get_commit(&index_entry.commit_id()).unwrap();+ eprintln!(+ "{change_id:?}, {change_id2:?}, {commit_id:?}",+ change_id2 = commit.change_id(),+ commit_id = index_entry.commit_id()+ );
if change_id.hex().starts_with(hex_prefix.hex()) {
if let Some(previous_change_id) = found_change_id.replace(change_id.clone()) {
if previous_change_id != change_id {
—
Reply to this email directly, view it on GitHub
<#924 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA7OTJ4BI2RR33TXNTJNTJ3WOJYE7ANCNFSM6AAAAAATFDXW6Y>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Good find! You should be able to work around it by removing the index, letting it be recalculated on next access. I don't know what would have caused this to happen. The fact that your report came so soon after PR #883 makes me think that I may have missed a reason that caching the store is not safe. I'll have to think more about that another day. Let me know if your |
No, it's newer I'm pretty sure. OTOH, I only upgraded the |
I ran into this again. Unfortunately, currently my |
Two possibly useful pieces of information:
|
In case it helps, here's another example. Here, a bunch of revisions are affected such as |
I am not 100% sure it's the same bug, but it seems so. I got into this repo state: (I ran
|
Ok, minimal script to create corrupted index: for i in `seq 10`; do
jj new root -m a &
done
wait
jj log --no-pager Maybe something wrong with concurrent & hash-conflicting commits? |
Wild guess:
|
If I understand correctly, the theory is that two things happen simultaneously:
Then, both processes write the change id they think is correct to the index, and havoc ensues. This sounds very plausible to me, thanks @yuja! |
Just for the record, quick and dirty repro script based on this scenario (might need to adjust parameters): set -e
set -x
rm -Rf repo
git init repo && jj init --git-repo=repo repo
#jj init --git repo
cd repo
export JJ_TIMESTAMP=1970-01-02T00:00:00+00:00
#jj new && jj branch set master
for i in `seq 10`; do
jj new -m "_${i}_"
#jj branch set "b$i"
done
for i in `seq 10`; do
rev="$(jj --ignore-working-copy log --no-graph -T commit_id -r 'description(_1_)')"
if [ "$(expr $i % 2)" -eq 0 ]; then
jj rebase -s "$rev" -d master &
else
jj rebase -s "$rev" -d root &
fi
for j in `seq 40`; do
#( jj git import; jj git export ) &
jj status > /dev/null &
done
wait
if jj --ignore-working-copy log -r 'all()' | grep hidden; then
break
fi
done
#wait
jj log --no-pager
#jj op log --no-pager |
Since non-Git metadata isn't hashed, we can't rely on the consistency provided by content-addressed storage. The problem is also described in jj-vcs#3 (comment) jj-vcs#924
My first attempt was to fix up corrupted index when merging, but it turned out to be not easy because the self side may contain corrupted data. It's also possible that two concurrent commit operations have exactly the same view state (because change id isn't hashed into commit id), and only the table heads diverge. jj-vcs#924
Since non-Git metadata isn't hashed, we can't rely on the consistency provided by content-addressed storage. The problem is also described in jj-vcs#3 (comment) jj-vcs#924
My first attempt was to fix up corrupted index when merging, but it turned out to be not easy because the self side may contain corrupted data. It's also possible that two concurrent commit operations have exactly the same view state (because change id isn't hashed into commit id), and only the table heads diverge. jj-vcs#924
Since non-Git metadata isn't hashed, we can't rely on the consistency provided by content-addressed storage. The problem is also described in #3 (comment) #924
My first attempt was to fix up corrupted index when merging, but it turned out to be not easy because the self side may contain corrupted data. It's also possible that two concurrent commit operations have exactly the same view state (because change id isn't hashed into commit id), and only the table heads diverge. #924
If I spawned ~20 "jj status &" processes, some of them panicked there. Spotted when debugging jj-vcs#924.
If I spawned ~20 "jj status &" processes, some of them panicked there. Spotted when debugging #924.
This is the source of the problem I noticed when debugging jj-vcs#924 and jj-vcs#1608. I don't think this can be easily fixed, so let's document it.
I can't seem to refer to some revisions by change id in
this repository state.
@yuja , might this have to do with some of your recent changes to change id resolution?
Let me know if this is a crazy typo I can't see.
The text was updated successfully, but these errors were encountered: