mirror of
https://github.com/minio/minio.git
synced 2025-11-21 02:09:08 -05:00
Add sync mode for 'xl.json' (#6798)
xl.json is the source of truth for all erasure coded objects, without which we won't be able to read the objects properly. This PR enables sync mode for writing `xl.json` such all writes go hit the disk and are persistent under situations such as abrupt power failures on servers running Minio.
This commit is contained in:
committed by
Nitish Tiwari
parent
cf26c937e4
commit
f1f23f6f11
@@ -221,6 +221,17 @@ func (client *storageRESTClient) AppendFile(volume, path string, buffer []byte)
|
||||
return err
|
||||
}
|
||||
|
||||
// WriteAll - write all data to a file.
|
||||
func (client *storageRESTClient) WriteAll(volume, path string, buffer []byte) error {
|
||||
values := make(url.Values)
|
||||
values.Set(storageRESTVolume, volume)
|
||||
values.Set(storageRESTFilePath, path)
|
||||
reader := bytes.NewBuffer(buffer)
|
||||
respBody, err := client.call(storageRESTMethodWriteAll, values, reader)
|
||||
defer CloseResponse(respBody)
|
||||
return err
|
||||
}
|
||||
|
||||
// StatFile - stat a file.
|
||||
func (client *storageRESTClient) StatFile(volume, path string) (info FileInfo, err error) {
|
||||
values := make(url.Values)
|
||||
|
||||
Reference in New Issue
Block a user