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

[Feature Request] Make copy order configurable #37

Open
ptoews opened this issue Jun 23, 2020 · 2 comments
Open

[Feature Request] Make copy order configurable #37

ptoews opened this issue Jun 23, 2020 · 2 comments

Comments

@ptoews
Copy link
Contributor

ptoews commented Jun 23, 2020

First of all, thank you for this great tool! It fits our use case pretty well.
There is just one thing: We would like to use this to sync databases that cannot always be connected to each other, therefore there are long periods where big amounts are collected but not immediately transferred. Connection periods are rather short and will be interrupted often (this seems to be handled already pretty well).

To prevent data fragmentation, it would be ideal that the data is therefore copied starting from the start timestamp instead of going backwards from the current point in time. Then the data on the destination db would never have any gaps.

I think this is the corresponding location in the code, and I couldn't find any already existing configurable options there:

syncflux/pkg/agent/sync.go

Lines 144 to 146 in dd51b97

//sync from newer to older data
endsec := eEpoch.Unix() - (i * chunkSecond)
startsec := eEpoch.Unix() - ((i + 1) * chunkSecond)

Thanks!

P.S: Sadly I don't have any experience in go, so a PR would be difficult.

@sbengo
Copy link
Collaborator

sbengo commented Jul 8, 2020

Hi @ptoews , sorry for the late answer

First of all, thanks for submitting this!

I'm not sure about your implementation and why you would like to change the copy order.
We selected going backwards in order to show to the user real time as soon as it is possible

Add a new option to change order could be great, addressing commments to your PR

Thanks,
Regards

@ptoews
Copy link
Contributor Author

ptoews commented Oct 6, 2020

Hi @sbengo , thanks for your answer.

To us it is important that there are no gaps in the data, so when the copy goes backwards and the cable is pulled out, the most recent points are copied but the rest is not, so there is a gap. If we could copy forwards, and the cable is pulled, there are no gaps, just the most recent data points are missing, which is much better to us than a gap.

Add a new option to change order could be great, addressing commments to your PR

Will do this as soon as I find the time!

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

No branches or pull requests

2 participants