# Tenants & golang

**URL:** <https://forums.foundationdb.org/t/tenants-golang/4408>\
**Category:** Development\
**Created:** [March 28, 2024, 7:45pm UTC](https://forums.foundationdb.org/t/tenants-golang/4408 "2024-03-28T19:45:12Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![newhook](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/newhook/32/1684_2.png) [@newhook](https://forums.foundationdb.org/u/newhook)\
**Post date:** [March 28, 2024, 7:45pm UTC](https://forums.foundationdb.org/t/tenants-golang/4408/1 "2024-03-28T19:45:12Z")

</div>

Has anyone written golang bindings for tenants? I know this feature is marked as experimental but is it ready for prime time?

---

<div class="post-metadata">

**Author:** ![newhook](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/newhook/32/1684_2.png) [@newhook](https://forums.foundationdb.org/u/newhook)\
**Post date:** [April 2, 2024, 1:27pm UTC](https://forums.foundationdb.org/t/tenants-golang/4408/2 "2024-04-02T13:27:55Z")

</div>

I found this. [Tenant Management Support in Go Bindings](https://forums.foundationdb.org/t/tenant-management-support-in-go-bindings/3982)

Any chance we can get this merged?

---

<div class="post-metadata">

**Author:** ![griffin](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/griffin/32/1604_2.png) [@griffin](https://forums.foundationdb.org/u/griffin)\
**Post date:** [April 2, 2024, 2:08pm UTC](https://forums.foundationdb.org/t/tenants-golang/4408/3 "2024-04-02T14:08:29Z")

</div>

Author here, happy to clean up the PR. Looking for a quick spot check before I spend time fixing the test failures.

We’ve been using this patch internally with no problems so far, though last I heard there are some upcoming breaking changes for tenants…?

---

<div class="post-metadata">

**Author:** ![newhook](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/newhook/32/1684_2.png) [@newhook](https://forums.foundationdb.org/u/newhook)\
**Post date:** [April 2, 2024, 4:36pm UTC](https://forums.foundationdb.org/t/tenants-golang/4408/4 "2024-04-02T16:36:17Z")

</div>

Hey Griffin, thanks for that. I’m just rebasing your changes on top of the 7.1.43 golang bindings that we’re using so I could test it locally.

I’m interested in hearing more about any breaking changes in tenanting?

---

<div class="post-metadata">

**Author:** ![griffin](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/griffin/32/1604_2.png) [@griffin](https://forums.foundationdb.org/u/griffin)\
**Post date:** [April 2, 2024, 6:29pm UTC](https://forums.foundationdb.org/t/tenants-golang/4408/5 "2024-04-02T18:29:52Z")

</div>

This is the last reference I saw to it:

> [@Tenant feature metadata changes in 7.2 release](https://forums.foundationdb.org/t/tenant-feature-metadata-changes-in-7-2-release/3459/1):
>
> For the 7.2 release, we are planning to make some updates to the way metadata is stored for tenants, and as a result any tenants created in a 7.1 cluster will not be usable upon upgrade. Instead, such clusters can be repopulated after the upgrade. This change will not impact any user that has explicitly opted into the use of this feature with one of the commands above. If anybody thinks they would be significantly impacted by this, let us know and we can provide suggestions to help make migration easier.

---

<div class="post-metadata">

**Author:** ![newhook](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/newhook/32/1684_2.png) [@newhook](https://forums.foundationdb.org/u/newhook)\
**Post date:** [April 2, 2024, 6:48pm UTC](https://forums.foundationdb.org/t/tenants-golang/4408/6 "2024-04-02T18:48:20Z")

</div>

That sounds mysterious?

> Instead, such clusters can be repopulated after the upgrade

Does that mean the tentant metadata needs to be repopulated, or actually all of the data would need to be moved around?

---

<div class="post-metadata">

**Author:** ![newhook](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/newhook/32/1684_2.png) [@newhook](https://forums.foundationdb.org/u/newhook)\
**Post date:** [April 2, 2024, 7:21pm UTC](https://forums.foundationdb.org/t/tenants-golang/4408/7 "2024-04-02T19:21:27Z")

</div>

Griffin,

One thing I noticed with your PR against 7.1 is that the system keyspace for tenants in your PR uses `"\xFF\xFF/management/tenant/map/"` which returns error 2115 in my testing.

According to the docs [Tenants — FoundationDB 7.1](https://apple.github.io/foundationdb/tenants.html?highlight=tenants), the keyspace should be `"\xFF\xFF/management/tenant_map/"`, which seems to work correctly.

Is this an error in your PR, or is this some incompatibility between 7.1 and 7.2?

---

<div class="post-metadata">

**Author:** ![newhook](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/newhook/32/1684_2.png) [@newhook](https://forums.foundationdb.org/u/newhook)\
**Post date:** [April 3, 2024, 2:46pm UTC](https://forums.foundationdb.org/t/tenants-golang/4408/8 "2024-04-03T14:46:29Z")

</div>

Looking at the 7.1 branch vs main it seems that the name of the tenant map special key has changed from `'\xff\xff/management/tenant_map/'` to `'\xff\xff/management/tenant/map/'` (which is perhaps the source of the tenant metadata change note?).

However, I can still see references to `tenant_map` in main, but I can’t tell whether that is some sort of backwards compatibility, or a bug.
