Skip to content

backend/kvfs: a new backend using lib/kv - #8445

Open
marcelowa wants to merge 4 commits into
rclone:masterfrom
marcelowa:kvfs
Open

marcelowa wants to merge 4 commits into
rclone:masterfrom
marcelowa:kvfs

Conversation

@marcelowa

Copy link
Copy Markdown

What is the purpose of this change?

Add a new backend: KVFS
Following @ncw proposal here #8386 (comment)

Checklist

  • I have read the contribution guidelines.
  • I have added tests for all changes in this PR if appropriate.
  • I have added documentation for the changes if appropriate.
  • All commit messages are in house style.
  • I'm done, this Pull Request is ready for review :-)

@marcelowa marcelowa changed the title Kvfs backend/kvfs: a new backend using lib/kv Mar 11, 2025
@marcelowa

Copy link
Copy Markdown
Author

Hi @ncw seems like it is failing specifically on other_os, it's like it's not considering the changes I made on lib/kv/bolt.go

# github.com/rclone/rclone/backend/hasher
Error: ../backend/hasher/hasher.go:160:60: too many arguments in call to kv.Start
	have ("context".Context, string, string, "github.com/rclone/rclone/fs".Fs)
	want ("context".Context, string, "github.com/rclone/rclone/fs".Fs)

@darthShadow

Copy link
Copy Markdown
Member

You will need to make the function signature changes in

// Start a key-value database
func Start(ctx context.Context, facility string, f fs.Fs) (*DB, error) {
return nil, ErrUnsupported
}

too because bolt.go has build restrictions for plan9 & js:

//go:build !plan9 && !js

@marcelowa

Copy link
Copy Markdown
Author

You will need to make the function signature changes in

// Start a key-value database
func Start(ctx context.Context, facility string, f fs.Fs) (*DB, error) {
return nil, ErrUnsupported
}

too because bolt.go has build restrictions for plan9 & js:

//go:build !plan9 && !js

Thanks for pointing this out
I made the change

@marcelowa

Copy link
Copy Markdown
Author

Seems like build / mac_amd64 failed on tests, I just don't think it is related to my changes

@darthShadow

Copy link
Copy Markdown
Member

We’ve talked before about adding sqlite as a kv implementation, so I wonder if it would make sense to combine this PR with the sqlite backend PR (#8387) by adding a sqlite-based kv implementation and allowing the kvfs backend to use either bolt or sqlite depending on a user-configurable option.

Let us see what @ncw thinks.

@marcelowa

marcelowa commented Mar 12, 2025 •

Copy link
Copy Markdown
Author

We’ve talked before about adding sqlite as a kv implementation, so I wonder if it would make sense to combine this PR with the sqlite backend PR (#8387) by adding a sqlite-based kv implementation and allowing the kvfs backend to use either bolt or sqlite depending on a user-configurable option.

Let us see what @ncw thinks.

I think @ncw suggested the kv implementation because the sqlite implementation introduced new dependencies into the project

@ncw

ncw commented Apr 9, 2025

Copy link
Copy Markdown
Member

Hi @marcelowa sorry for the delay in looking at this. I like this much better than the sqlite version as it uses stuff we already have built into rclone.

Can you get the unit tests and the integration tests working? I tried the unit tests and they didn't work for me.

@ncw ncw mentioned this pull request Apr 9, 2025
@marcelowa
marcelowa force-pushed the kvfs branch 2 times, most recently from f7e5fdf to bcc2415 Compare April 14, 2025 07:21
@marcelowa

Copy link
Copy Markdown
Author

Hi @marcelowa sorry for the delay in looking at this. I like this much better than the sqlite version as it uses stuff we already have built into rclone.

Can you get the unit tests and the integration tests working? I tried the unit tests and they didn't work for me.

@ncw Thanks for the feedback, hopefully I fixed the tests
Please trigger the workflows

@marcelowa

Copy link
Copy Markdown
Author

@ncw @darthShadow most of the build process went well :) , I don't think the windows build failures are related to my changes

@marcelowa

Copy link
Copy Markdown
Author

@ncw @darthShadow I rebased the code to keep it aligned with master, please rerun the workflows

@ncw

ncw commented Jun 24, 2025

Copy link
Copy Markdown
Member

Hi @marcelowa sorry about the delay looking at this. Let's try to get it merged for 1.71

How are the integration tests looking?

@ncw ncw added this to the v1.71 milestone Jun 24, 2025
@marcelowa

Copy link
Copy Markdown
Author

@ncw it looks like everything passed :)

@ncw ncw modified the milestones: v1.71, v1.72 Sep 4, 2025
@marcelowa

Copy link
Copy Markdown
Author

rebased

@ncw ncw modified the milestones: v1.72, v1.73 Nov 24, 2025
@ncw ncw modified the milestones: v1.73, v1.74 Feb 17, 2026
@ncw ncw modified the milestones: v1.74, v1.75 May 5, 2026
@ncw ncw modified the milestones: v1.75, v1.76, v1.77 Nov 3, 2026
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

Successfully merging this pull request may close these issues.

3 participants