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
Removing or listing pins gives inconsistent results between cluster CLI and proxied API. #380
Comments
I think you didn't issue your unpin against :9095 but against :5001 instead. I know because cluster never returns: Can you double check it? I can't reproduce this. |
@hsanjuan I'll test ASAP - but I am pretty positive all requests were performed on |
Good afternoon, I apologise as I had to take care of personal things and couldn't report before. EDIT and possible solution: I discovered that the proxy catches the pins when the CID is passed in iex(one@127.0.0.1)1> alias App.IPFS, as: IPFS
IPFS
iex(one@127.0.0.1)2> %IPFS{}
%IPFS{base: "api/v0", host: "localhost", port: 9095, scheme: "http"}
iex(one@127.0.0.1)3> conn |> IPFS.pin_ls()
{:ok, %{"Keys" => %{}}}
iex(one@127.0.0.1)4> conn |> IPFS.add("/home/doodloo/Pictures/Very Nice Great Success.jpg")
{:ok,
%{
"Hash" => "QmQChpnJJ5am4HRiW7b1KZtBEBeWy3azovVMCL3xsFVUL3",
"Name" => "QmQChpnJJ5am4HRiW7b1KZtBEBeWy3azovVMCL3xsFVUL3",
"Size" => "44722"
}}
iex(one@127.0.0.1)5> conn |> IPFS.pin_ls()
{:ok,
%{
"Keys" => %{
"QmQChpnJJ5am4HRiW7b1KZtBEBeWy3azovVMCL3xsFVUL3" => %{
"Type" => "recursive"
}
}
}}
iex(one@127.0.0.1)6> conn |> IPFS.pin_rm("QmQChpnJJ5am4HRiW7b1KZtBEBeWy3azovVMCL3xsFVUL3")
{:ok, %{"Pins" => ["QmQChpnJJ5am4HRiW7b1KZtBEBeWy3azovVMCL3xsFVUL3"]}}
iex(one@127.0.0.1)7> conn |> IPFS.pin_rm("QmQChpnJJ5am4HRiW7b1KZtBEBeWy3azovVMCL3xsFVUL3")
{:error, "Error status code: 500, {\"Message\":\"not pinned\",\"Code\":0}\n"}
iex(one@127.0.0.1)8> conn |> IPFS.pin_ls()
{:ok,
%{
"Keys" => %{
"QmQChpnJJ5am4HRiW7b1KZtBEBeWy3azovVMCL3xsFVUL3" => %{
"Type" => "recursive"
}
}
}} At this point, pinning statuses start to differ like I stated in my original post. You will notice that the client uses the same connection all the way through ( Here are the associated logs from the cluster:
As a side note, I have to very strongly advocate against having IPFS cluster require the developer to hit something else than the proxy - an IPFS client should be completely agnostic to whether or not it's talking to IPFS or IPFS cluster, and the pinning / unpinning magic should be done automatically IMO. Maybe the way we pin isn't caught by the proxy - we use |
@hickscorp did you close this for some reason? OK, I know the problem now. Cluster intercepts Relevant code: https://github.com/ipfs/go-ipfs-cmds/blob/master/http/parse.go#L42
The IPFS API does not support nor play well with cluster functionality. The proxy is provided as convenience to help transition to cluster on on side, but it's mostly to enable composition. |
@hsanjuan I understand that the IPFS API does not support or play well with cluster functionality. I'm talking about the other way around - that a cluster is an overlay on top of IPFS, and that the proxying feature should receive top notch support, because it would allow IPFS cluster to be a drop-in replacement of IPFS for software that hit the IPFS API without any changes to these softwares. |
@hickscorp yes, we agree :) |
Fixed in #392 |
We have two test clusters each talking to its individual IPFS node. When using
ipfs-cluster-ctl
on either one of the clusters, we're able to pin and unpin, and then when issuing aipfs-cluster-ctl pin ls
on the other cluster we see that it propagated. We know the clusters are communicative.However, here is something very weird that happens. Using the proxied API, we list pins, we get:
So far so good, and verified using
ipfs-cluster-ctrl pin ls
too. Then we issue an unpinning order on proxied:9095
. This is what we get:Brilliant. Now for sanity check, we issue the same
pin rm
on the proxied API:Perfect, expected. Let's verify the pinning status using the cli tool:
Oops. Examining the cluster logs doesn't show unpinning either!
What to believe? How to reliably
pin ls
using the:9095
proxy?The text was updated successfully, but these errors were encountered: