Skip to content

Conversation

@larsewi
Copy link
Contributor

@larsewi larsewi commented Nov 19, 2024

  • Added file stream API
  • New network protocol version v4 - filestream

TODO:

Build Status

@larsewi larsewi force-pushed the librsync branch 7 times, most recently from c29dfd8 to 937589a Compare November 20, 2024 12:43
@larsewi larsewi force-pushed the librsync branch 8 times, most recently from 37a8af2 to 9cb3c14 Compare November 28, 2024 13:53
@larsewi larsewi marked this pull request as ready for review November 28, 2024 13:54
@larsewi larsewi force-pushed the librsync branch 3 times, most recently from fafd971 to af5bd02 Compare November 29, 2024 10:51
Copy link
Contributor

@vpodzime vpodzime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me otherwise. Very nice! Thanks for taking the hard road! 👏 🍻 I'm very excited about this!

@larsewi larsewi force-pushed the librsync branch 3 times, most recently from b627503 to 2e808ed Compare December 2, 2024 09:10
vpodzime
vpodzime previously approved these changes Dec 2, 2024
Copy link
Contributor

@vpodzime vpodzime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's see if it works! 😁 🤞 🍻

Copy link
Contributor

@craigcomstock craigcomstock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments and little typos.

@larsewi larsewi force-pushed the librsync branch 5 times, most recently from f728290 to 8ad0742 Compare December 5, 2024 14:32
vpodzime
vpodzime previously approved these changes Dec 6, 2024
Copy link
Contributor

@vpodzime vpodzime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

craigcomstock
craigcomstock previously approved these changes Dec 6, 2024
@larsewi
Copy link
Contributor Author

larsewi commented Dec 9, 2024

Just tested this manually on Windows and it works like a charm.

PS C:\Program Files\Cfengine\bin> .\cf-agent.exe -KI
    info: Copied file '/var/cfengine/masterfiles/promises.cf' from '172.31.39.27' to 'C:\promises.cf.cfnew'
    info: Moved 'C:\promises.cf.cfnew' to 'C:\promises.cf'
    info: Updated file 'C:\promises.cf' from '172.31.39.27:/var/cfengine/masterfiles/promises.cf'

Did however find a separate (surprisingly unrelated) issue in cf-net.exe (see ENT-12511)

larsewi and others added 7 commits December 11, 2024 13:18
This commit was added while working on implementing the File Stream API
in ticket ENT-12414. The File Stream API utilizes librsync.  To begin
with I had `AC_CHECK_HEADERS([librsync_export.h], [],
AC_MSG_ERROR(Cannot find librsync))` in configure.ac. This file did not
exist in earlier versions of librync. Hence, I upgraded the Ubuntu
platforms in GitHub CI to make configure work. Later a realized that I
should remove that line enirely to make CFEngine compatible with earlier
versions. However, it does not hurt to upgrade the Ubuntu platforms, so
decided on keeping this commit.

Ticket: None
Changelog: None
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
After upgrading GitHub CI platorms to Ubuntu 24, the ASAN Unit Tests
started complaining about One Definition Rule (ODR) violations. Hence, I
disabled ODR and created a follow-up ticket (see CFE-4454) to fix the
violations and enable ODR again.

Ticket: None
Changelog: None
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Ticket: ENT-12414
Changelog: None
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Added API for streaming file contents over the network using the RSYNC
algorithm from librsync.

Ticket: ENT-12414
Changelog: None
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Co-authored-by: Craig Comstock <craig.comstock@northern.tech>
Ticket: ENT-12414
Changelog: Title
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Co-authored-by: Craig Comstock <craig.comstock@northern.tech>
The implementation is based on the previous protocol for `GET
<FILENAME>` requests that used sparse files.

Ticket: ENT-12414
Changelog: Title
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Apparently there are functions called `SendMessage()` and
`GetFileSize()` in the Win32 API. I fixed these name conflicts by adding
a `Protocol` prefix to all functions related to the simple network
protocol for file stream communication. Furthermore, I changed the name
of `GetFileSize()` to `GetSizeOfFile()`.

Ticket: ENT-12414
Changelog: None
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
@larsewi larsewi merged commit 0b53a32 into cfengine:master Dec 13, 2024
42 of 48 checks passed
@larsewi larsewi deleted the librsync branch December 18, 2024 08:08
craigcomstock pushed a commit to craigcomstock/core that referenced this pull request Sep 22, 2025
Signed-off-by: Ole Herman Schumacher Elgesem <ole@northern.tech>
(cherry picked from commit 1486c24)

 Conflicts:
	.github/workflows/macos_unit_tests.yml

Use of librsync (cfengine#5629) was not cherry picked to 3.24.x
craigcomstock pushed a commit to craigcomstock/core that referenced this pull request Sep 22, 2025
Check for Homebrew if we're on Darwin and use brew's --prefix.

Ticket: CFE-4385
(cherry picked from commit 7e88d4b)

 Conflicts:
	.github/workflows/macos_unit_tests.yml
	configure.ac

using librsync (cfengine#5629) was not cherry-picked to 3.24.x so adjustments were needed.
craigcomstock pushed a commit to craigcomstock/core that referenced this pull request Sep 23, 2025
Signed-off-by: Ole Herman Schumacher Elgesem <ole@northern.tech>
(cherry picked from commit 1486c24)

 Conflicts:
	.github/workflows/macos_unit_tests.yml

Use of librsync (cfengine#5629) was not cherry picked to 3.24.x

(cherry picked from commit d91eebd)

 Conflicts:
	.github/workflows/macos_unit_tests.yml

Had to adjust as 3.21 uses pcre not pcre2 as the commit from newer branch had.
craigcomstock pushed a commit to craigcomstock/core that referenced this pull request Sep 23, 2025
Check for Homebrew if we're on Darwin and use brew's --prefix.

Ticket: CFE-4385
(cherry picked from commit 7e88d4b)

 Conflicts:
	.github/workflows/macos_unit_tests.yml
	configure.ac

using librsync (cfengine#5629) was not cherry-picked to 3.24.x so adjustments were needed.

(cherry picked from commit faf08d9)

 Conflicts:
	.github/workflows/macos_unit_tests.yml
	configure.ac

Needed some finesse as rsync and pcre2 were in commit and not used in 3.21.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants