apple / foundationdb

FoundationDB - the open source, distributed, transactional key-value store
https://apple.github.io/foundationdb/
Apache License 2.0
14.33k stars 1.3k forks source link

Golang: ReadTransaction should expose TransactionOptions #6265

Closed johscheuer closed 2 years ago

johscheuer commented 2 years ago

It would be useful if the ReadTransaction would expose the TransactionOptions like a normal transaction. that would allow users to use a read transaction to read from the system key space (e.g. the management API in the future). Without that we are not able to set the transaction.Options().SetAccessSystemKeys() option to allow access to the system key space. We would like to use read transactions in our implementation, e.g. in the Kubernetes FDB operator to ensure we are only reading from the system key space for most of our operations.

sfc-gh-anoyes commented 2 years ago

that would allow users to use a read transaction to read from the system key space (e.g. the management API in the future)

I think you're confusing the system key space [\xff, \xff\xff) with the special key space [\xff\xff, \xff\xff\xff). The management API in the future will be exposed through the special key space.

That said, it does make sense to have transaction options exposed in ReadTransaction and other bindings (e.g. the java bindings) do that.

@johscheuer I have a draft PR which I think resolves this issue. Let me know if this works for you. https://github.com/apple/foundationdb/pull/6318