Commit d1e0c47
committed
Extract SPOG org-id from cluster http_path for non-Thrift requests
For all-purpose-compute Thrift connections on SPOG (custom-URL) hosts the
http_path is /sql/protocolv1/o/<workspace-id>/<cluster-id> and the
workspace ID is encoded in the path itself. PoPP routes the Thrift
request correctly off the /o/<wsid>/ segment, so the connection succeeds
without an explicit ?o= query parameter.
Other requests on the same connection (telemetry uploads to
/telemetry-ext, feature-flag fetches, SEA REST calls) hit different
paths that don't carry the workspace ID. Previously _extract_spog_headers
only looked at ?o= in the http_path, so the x-databricks-org-id header
was never set for cluster URLs without ?o=. On SPOG hosts PoPP then had
no workspace context for these requests and redirected them to /login,
silently dropping telemetry.
Extend _extract_spog_headers to also extract the workspace ID from the
cluster path segment as a fallback when ?o= is absent. Priority order:
explicit caller header > ?o= query param > /o/<wsid>/ path segment.
Adds five unit tests covering the new cluster-path extraction, leading
slash, query-param-wins priority, explicit-header-wins priority, and a
warehouse-path regression guard.
Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>1 parent 0309e7c commit d1e0c47
2 files changed
Lines changed: 89 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
170 | 171 | | |
171 | 172 | | |
172 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
173 | 178 | | |
174 | 179 | | |
175 | | - | |
176 | | - | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
177 | 198 | | |
178 | 199 | | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
| 200 | + | |
| 201 | + | |
185 | 202 | | |
186 | | - | |
187 | | - | |
| 203 | + | |
| 204 | + | |
188 | 205 | | |
189 | 206 | | |
190 | 207 | | |
191 | | - | |
192 | | - | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
193 | 228 | | |
194 | | - | |
195 | | - | |
196 | | - | |
| 229 | + | |
| 230 | + | |
197 | 231 | | |
198 | 232 | | |
199 | 233 | | |
200 | 234 | | |
201 | | - | |
202 | | - | |
| 235 | + | |
203 | 236 | | |
| 237 | + | |
204 | 238 | | |
205 | 239 | | |
206 | 240 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
273 | 273 | | |
274 | 274 | | |
275 | 275 | | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
0 commit comments