You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We added a "next-item" style query as part of #1298 to find the next available external IP address. This currently searches over all pools, and all ranges in those pools. Because of the implementation in CRDB, this is particularly bad for performance. Subqueries are fully-materialized and stored in memory before the surrounding query is run. So, if a user creates an IP Pool with an IPv6 /64 range, which is a pretty natural thing to do, the query will absolutely grind to a halt. The database doesn't appear to fall over now, but the query will basically never complete. Some of this is referred to in #1371.
Additionally, as part of #1458, we modified the query to now search all pools that are "available" to an instance, e.g., pools with a NULL project ID or with the project ID equal to the instance's project ID. That's fine, but we're also currently duplicating the project ID in the parent ip_pool table and the ip_pool_range table. That denormalizes the database a bit, but it's to avoid yet another join in the already-terrible query, which would be used to get the project ID from the parent table (joining on the ip_pool_range.ip_pool_id foreign-key into the ip_pool table). This was discussed here.
The query is here. It should just be...better...but it's not clear exactly how yet.
The text was updated successfully, but these errors were encountered:
Note to self. I've used a new pattern a few times, e.g., in VPCs, to search a limited range in any particular NextItem query. That lets us retry an allocation a bunch of times, with each one being relatively efficient in the DB. Use that here, and possibly make it part of the NextItem API itself (through a new LimitedShiftGenerator or something).
We added a "next-item" style query as part of #1298 to find the next available external IP address. This currently searches over all pools, and all ranges in those pools. Because of the implementation in CRDB, this is particularly bad for performance. Subqueries are fully-materialized and stored in memory before the surrounding query is run. So, if a user creates an IP Pool with an IPv6
/64
range, which is a pretty natural thing to do, the query will absolutely grind to a halt. The database doesn't appear to fall over now, but the query will basically never complete. Some of this is referred to in #1371.Additionally, as part of #1458, we modified the query to now search all pools that are "available" to an instance, e.g., pools with a NULL project ID or with the project ID equal to the instance's project ID. That's fine, but we're also currently duplicating the project ID in the parent
ip_pool
table and theip_pool_range
table. That denormalizes the database a bit, but it's to avoid yet another join in the already-terrible query, which would be used to get the project ID from the parent table (joining on theip_pool_range.ip_pool_id
foreign-key into theip_pool
table). This was discussed here.The query is here. It should just be...better...but it's not clear exactly how yet.
The text was updated successfully, but these errors were encountered: