Skip to content
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

fix(share/eds): dagstore shard restore reflection workaround #2559

Merged
merged 4 commits into from
Aug 14, 2023

Conversation

walldiss
Copy link
Member

@walldiss walldiss commented Aug 11, 2023

Turns out dagstore has bug in its restore shard code. For each shard it attempts to create deep copy of registered type, but copies only basic struct fields of the mount type. In out case it means, that it copies a pointer. That causes all shards to point to the same mount (same pointer).
Before dagstore is fixed to take into account possibility of pointers/interface (and any other reference type) in mount type struct fields, we will use direct copy of mount.FileMount instead of mount.Mount interface.

@walldiss walldiss added the kind:fix Attached to bug-fixing PRs label Aug 11, 2023
@walldiss walldiss self-assigned this Aug 11, 2023
@codecov-commenter
Copy link

codecov-commenter commented Aug 11, 2023

Codecov Report

Merging #2559 (eafcc96) into main (87e9500) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #2559      +/-   ##
==========================================
- Coverage   51.05%   51.03%   -0.02%     
==========================================
  Files         158      158              
  Lines       10398    10398              
==========================================
- Hits         5309     5307       -2     
- Misses       4622     4628       +6     
+ Partials      467      463       -4     
Files Changed Coverage Δ
share/eds/store.go 60.00% <100.00%> (ø)

... and 7 files with indirect coverage changes

@walldiss walldiss marked this pull request as ready for review August 11, 2023 12:41
@Wondertan
Copy link
Member

Let's link the issue on the dagstore here

share/eds/store.go Show resolved Hide resolved
@walldiss walldiss merged commit 003c2c4 into celestiaorg:main Aug 14, 2023
12 of 14 checks passed
@distractedm1nd
Copy link
Collaborator

filecoin-project/dagstore#161

Linking

renaynay pushed a commit to renaynay/celestia-node that referenced this pull request Aug 23, 2023
…aorg#2559)

Turns out `dagstore` has bug in its restore shard code. For each shard
it attempts to create deep copy of registered type, but copies only
basic struct fields of the mount type. In out case it means, that it
copies a pointer. That causes all shards to point to the same mount
(same pointer).
Before `dagstore` is fixed to take into account possibility of
pointers/interface (and any other reference type) in mount type struct
fields, we will use direct copy of `mount.FileMount` instead of
`mount.Mount` interface.
walldiss added a commit to walldiss/celestia-node that referenced this pull request Sep 22, 2023
…aorg#2559)

Turns out `dagstore` has bug in its restore shard code. For each shard
it attempts to create deep copy of registered type, but copies only
basic struct fields of the mount type. In out case it means, that it
copies a pointer. That causes all shards to point to the same mount
(same pointer).
Before `dagstore` is fixed to take into account possibility of
pointers/interface (and any other reference type) in mount type struct
fields, we will use direct copy of `mount.FileMount` instead of
`mount.Mount` interface.

(cherry picked from commit 003c2c4)
walldiss added a commit that referenced this pull request Sep 22, 2023
Turns out `dagstore` has bug in its restore shard code. For each shard
it attempts to create deep copy of registered type, but copies only
basic struct fields of the mount type. In out case it means, that it
copies a pointer. That causes all shards to point to the same mount
(same pointer).
Before `dagstore` is fixed to take into account possibility of
pointers/interface (and any other reference type) in mount type struct
fields, we will use direct copy of `mount.FileMount` instead of
`mount.Mount` interface.

(cherry picked from commit 003c2c4)
walldiss added a commit to walldiss/celestia-node that referenced this pull request Sep 22, 2023
…aorg#2559)

Turns out `dagstore` has bug in its restore shard code. For each shard
it attempts to create deep copy of registered type, but copies only
basic struct fields of the mount type. In out case it means, that it
copies a pointer. That causes all shards to point to the same mount
(same pointer).
Before `dagstore` is fixed to take into account possibility of
pointers/interface (and any other reference type) in mount type struct
fields, we will use direct copy of `mount.FileMount` instead of
`mount.Mount` interface.

(cherry picked from commit 003c2c4)
walldiss added a commit to walldiss/celestia-node that referenced this pull request Sep 25, 2023
…aorg#2559)

Turns out `dagstore` has bug in its restore shard code. For each shard
it attempts to create deep copy of registered type, but copies only
basic struct fields of the mount type. In out case it means, that it
copies a pointer. That causes all shards to point to the same mount
(same pointer).
Before `dagstore` is fixed to take into account possibility of
pointers/interface (and any other reference type) in mount type struct
fields, we will use direct copy of `mount.FileMount` instead of
`mount.Mount` interface.

(cherry picked from commit 003c2c4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:fix Attached to bug-fixing PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants