chengshiwen / influx-proxy

InfluxDB Proxy with High Availability and Consistent Hash
https://github.com/chengshiwen/influx-proxy/wiki
MIT License
354 stars 112 forks source link

the data rewrite success but the data file still here and the file size not change #11

Closed SUNRise666s closed 3 years ago

SUNRise666s commented 3 years ago

truncate error: truncate F:\SYN\influx-proxy\data\influxdb-2-1.dat: Access is denied.

the data rewrite success but the data file still here and the file size not change

chengshiwen commented 3 years ago

Which version? And please check the permission

SUNRise666s commented 3 years ago

thank you for response! It build on Windows and run on Windows

the error code is below.

你好,我编译的是windows的版本,是在windows运行

错误代码我调整如下便没报错

/*err = fb.producer.Truncate(0)
if err != nil {
    log.Print("truncate error: ", err)
    return
}*/

pathname := filepath.Join(fb.datadir, fb.filename)
filename := pathname + ".dat"
err = os.Truncate(filename,0)
if err != nil {
    log.Print("truncate error: ", err)
    return
}
SUNRise666s commented 3 years ago

Version is the latest 2.5.5

chengshiwen commented 3 years ago

Thanks for your feedback! I will also check the changes in Linux and Mac

SUNRise666s commented 3 years ago

Thank you for response!Linux is ok and it's useful,I had Checked.By the way, it's not support for windows?

chengshiwen commented 3 years ago

I haven't tested it on Windows, but Linux has been verified in the production environment of many our customers for long time

chengshiwen commented 3 years ago

Close by https://github.com/chengshiwen/influx-proxy/commit/5340e795448dd563475a387033a58392bc253056