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

WIP:standalone raftexample #41

Closed
wants to merge 1 commit into from

Conversation

Elbehery
Copy link
Member

@Elbehery Elbehery commented Mar 31, 2023

Signed-off-by: Mustafa Elbehery [email protected]

resolves #2

This PR contains only https://github.com/etcd-io/etcd/tree/main/contrib/raftexample files

I try to use go modules, but I have issue vendoring wal from etcd repo

cc @ahrtr @spzala

@Elbehery
Copy link
Member Author

I have this error while vendoring

go: module go.etcd.io/etcd/server/v3@upgrade found (v3.5.7), but does not contain package go.etcd.io/etcd/server/v3/storage/wal

go: module go.etcd.io/etcd/server/v3@upgrade found (v3.5.7), but does not contain package go.etcd.io/etcd/server/v3/storage/wal/walpb

go mod tidy
go: finding module for package go.etcd.io/etcd/server/v3/storage/wal/walpb
go: finding module for package go.etcd.io/etcd/server/v3/storage/wal
go.etcd.io/raft/v3/raftexample imports
	go.etcd.io/etcd/server/v3/storage/wal: module go.etcd.io/etcd/server/v3@latest found (v3.5.7), but does not contain package go.etcd.io/etcd/server/v3/storage/wal
go.etcd.io/raft/v3/raftexample imports
	go.etcd.io/etcd/server/v3/storage/wal/walpb: module go.etcd.io/etcd/server/v3@latest found (v3.5.7), but does not contain package go.etcd.io/etcd/server/v3/storage/wal/walpb

Signed-off-by: Mustafa Elbehery <[email protected]>
@Elbehery
Copy link
Member Author

Elbehery commented Apr 1, 2023

I fixed the vendoring errors

Now there is another issue, the code in raft.go within raft repo uses snapshotter which is a dependency from etcd, and it uses types from etcd repo

This func call here from raft repo, uses this type from etcd

I am stuck :/

@Elbehery
Copy link
Member Author

Elbehery commented Apr 4, 2023

@serathius hello ✋🏽

I am sorry to cite you again about that :), i am just stuck with this

maybe if the refactoring PR from etcd-io/etcd#15471 is merged, it is better ?

@ahrtr
Copy link
Member

ahrtr commented Apr 11, 2023

@Elbehery I see that you created two PRs: #40 and #41. can you close one of them?

Please note that the raft example shouldn't depend on etcd at all. Also please remove the vendor directory.

@Elbehery
Copy link
Member Author

thanks @ahrtr

So i moved the raft example to this repo, but the dependencies are needed by the example, how can I move it here ?

I tried to move the minimal code needed

@ahrtr
Copy link
Member

ahrtr commented Apr 12, 2023

So i moved the raft example to this repo

It isn't correct. The original raftexample is just for your reference. You need to create a new self-contained example, which shouldn't depend on etcd at all.

@Elbehery
Copy link
Member Author

Ok, now it makes sense to me .. I apologise for not understanding fully since the beginning ..

Is it possible to move etcd-io/etcd#15471 forward, because using interfaces could make it simpler ?

@ahrtr
Copy link
Member

ahrtr commented Apr 12, 2023

Is it possible to move etcd-io/etcd#15471 forward, because using interfaces could make it simpler ?

Yes, it makes sense to me. But you also need to remove the dependency on etcd.

@Elbehery
Copy link
Member Author

thanks a lot for your clarification 🙏🏽

@Elbehery Elbehery closed this Jun 1, 2023
@Elbehery Elbehery deleted the raftexample-selfcontained branch June 1, 2023 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement a self-contained raft example
2 participants