Migrate registry from previous incorrect path#10486
Conversation
71aceda to
8060df4
Compare
8060df4 to
a9d4955
Compare
journalbeat/checkpoint/checkpoint.go
Outdated
There was a problem hiding this comment.
We should close the files before calling SafeFileRotate. Also check that Close does not error.
journalbeat/checkpoint/checkpoint.go
Outdated
There was a problem hiding this comment.
you still need to close target if this one fails.'
Why do we need to copy anyways? Isn't SafeFileRotate in order to move the file good enough?
The use of SafeFileRotate suggests a backup file is written and then rotated to c.file. When is c.file+".bak" written?
There was a problem hiding this comment.
It was a mistake from me. I removed it, because it was unnecessary.
journalbeat/checkpoint/checkpoint.go
Outdated
There was a problem hiding this comment.
the copy is not 'safe' without extra call to target.Sync(). Some filesystems (without journaling) also require a sync operation on the parent directory in order to sync file + directory meta data.
b9b2f74 to
6fc47dd
Compare
6166aaf to
5c73b8e
Compare
| pf, _ := os.Open(p) | ||
| if err != nil { | ||
| return nil | ||
| } |
|
All relevant tests are green. |
In 6.x Journalbeat placed its registry file under the wrong path ignoring the data.path settings. This patch lets users migrate from registries under such paths when upgrading from 6.x to 7.x. (cherry picked from commit 9499811)
In 6.x Journalbeat placed its registry file under the wrong path ignoring the data.path settings. This patch lets users migrate from registries under such paths when upgrading from 6.x to 7.x. (cherry picked from commit 9499811)
In 6.x Journalbeat placed its registry file under the wrong path ignoring the data.path settings. This patch lets users migrate from registries under such paths when upgrading from 6.x to 7.x. (cherry picked from commit 9499811)
In 6.x Journalbeat placed its registry file under the wrong path ignoring the data.path settings. This patch lets users migrate from registries under such paths when upgrading from 6.x to 7.x.
…rrect path (elastic#10597) In 6.x Journalbeat placed its registry file under the wrong path ignoring the data.path settings. This patch lets users migrate from registries under such paths when upgrading from 6.x to 7.x. (cherry picked from commit 9499811)
In 6.x Journalbeat placed its registry file under the wrong path ignoring the data.path settings.
This patch lets users migrate from registries under such paths when upgrading from 6.x to 7.x.