a few questions about uploading a file

19 views
Skip to first unread message

Shahar Fleischman

unread,
Apr 23, 2014, 6:54:20 AM4/23/14
to weed-fil...@googlegroups.com

hi,

i want to know how replication works in weedfs(and a couple of more questions :) ).

1. when uploading a file to a volume server directly, who handles the replication, and what is the strategy for replicating(how do you choose a server in your rack or DC) ?
2. when uploading a file to a master server, who handles the replication, and what is the strategy for replicating(how do you choose a server in your rack or DC) ?
3. when uploading a file via a master server, how can i set the file id(like you can do when uploading to a volume server directly) ?
4. what are the limitations of the file id name, i've noticed it can take a-z, 0-9, but needs to be 12 chars long ?
5. is there an automatic re-replication of volumes, when a volume server fails ?

thanks,
shahar.


The above terms reflect a potential business arrangement, are provided solely as a basis for further discussion, and are not intended to be and do not constitute a legally binding obligation. No legally binding obligations will be created, implied, or inferred until an agreement in final form is executed in writing by all parties involved.

This email and any attachments hereto may be confidential or privileged.  If you received this communication by mistake, please don't forward it to anyone else, please erase all copies and attachments, and please let me know that it has gone to the wrong person. Thanks.

Shahar Fleischman

unread,
Apr 23, 2014, 7:02:54 AM4/23/14
to weed-fil...@googlegroups.com
just adding to the question below,
the reason i want to upload via the master server is that this way it creates volumes as necessary.
i've also noticed that when uploading via master, it created 3 volumes on server 1 and 4 volumes on server 3, but no volumes on server 2, can you explain why ?

thanks.

Chris Lu

unread,
Apr 23, 2014, 12:34:54 PM4/23/14
to weed-fil...@googlegroups.com
In general, I think you may have some misunderstanding about fileId.
 
1. when uploading a file to a volume server directly, who handles the replication, and what is the strategy for replicating(how do you choose a server in your rack or DC) ?
The volume server handles replication. The replication is tied to the volume id. The volume id is assigned via the master server. 
2. when uploading a file to a master server, who handles the replication, and what is the strategy for replicating(how do you choose a server in your rack or DC) ?
Same answer as above. 
3. when uploading a file via a master server, how can i set the file id(like you can do when uploading to a volume server directly) ?
The master server just forward the upload request to a volume server that has this volume id. 
4. what are the limitations of the file id name, i've noticed it can take a-z, 0-9, but needs to be 12 chars long ?
Please read the format definition in file_id.go. There are 3 parts in the file id <volumeId, fileKey, cookie>.

type FileId struct {
VolumeId VolumeId
Key      uint64
Hashcode uint32
}

5. is there an automatic re-replication of volumes, when a volume server fails ?
 No. If a volume server fails, all volumes with the same volume id on that server will become readonly.

Chris Lu

unread,
Apr 23, 2014, 12:37:35 PM4/23/14
to weed-fil...@googlegroups.com
The volume placement is random. If each server only has few volumes, the placement may look unbalanced. But when the next time new volumes are created, the servers with more empty slots will have higher probability to host a new volume.

Chris

--
You received this message because you are subscribed to the Google Groups "Weed File System" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weed-file-syst...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages