morningman opened a new pull request, #68966:
URL: https://github.com/apache/doris/pull/68966

   ### What problem does this PR solve?
   
   Issue Number: None
   
   Related PR: #68965
   
   Problem Summary:
   
   **In short.** On a Kerberos catalog, every Iceberg scan runs on a wrapper 
table that drops the table's metrics reporter, so the catalog's reporter never 
receives a scan report from such a catalog. This PR passes the table's reporter 
to the wrapper. It is not a branch-4.x port; it came up next to #68965, which 
fixes the same loss for historical-schema scans.
   
   **Background.** Iceberg reports each scan's metrics through the 
`MetricsReporter` that `BaseTable` holds; a catalog can configure one, for 
example through `metrics-reporter-impl`. On a Kerberos catalog, 
`IcebergScanPlanProvider.wrapTableForScan` wraps every scanned table in a new 
`BaseTable` whose `FileIO` runs inside the plugin's doAs, so that Iceberg's 
worker threads read files with the right credentials.
   
   **The problem, and what it cost.**
   
   | Table | Reporter of the scanned table on master | With this PR |
   |---|---|---|
   | Kerberos catalog, `wrapTableForScan` | `LoggingMetricsReporter` (the 
two-argument `BaseTable` constructor's default), for current and historical 
schemas alike | the table's reporter |
   | Kerberos catalog, `wrapTableForProcedure` | the table's reporter | 
unchanged |
   | Snapshot tables of `IcebergTableCache` and `IcebergStatementScope` | the 
table's reporter | unchanged |
   
   Query results were not affected.
   
   **How this PR fixes it.** `wrapTableForScan` builds the wrapper with the 
three-argument constructor and the table's reporter, as `wrapTableForProcedure` 
and the snapshot tables already do.
   
   **Results.** The new unit test wraps a table that carries a custom reporter 
under a Kerberos context: before the fix the wrapper holds 
`LoggingMetricsReporter`, after it the table's reporter. All 
fe-connector-iceberg tests pass (1525).
   
   ### Release note
   
   Scans of Iceberg tables in Kerberos catalogs are reported to the catalog's 
metrics reporter.
   
   ### Check List (For Author)
   
   - Test <!-- At least one of them must be included. -->
       - [ ] Regression test
       - [x] Unit Test
           - 
`IcebergScanPlanProviderKerberosScanIoTest#wrapTableForScanKeepsTheTableMetricsReporter`
 fails without the fix and passes with it; all fe-connector-iceberg tests 
(1525) pass.
       - [ ] Manual test (add detailed scripts or steps below)
       - [ ] No need to test or manual test. Explain why:
           - [ ] This is a refactor/code format and no logic has been changed.
           - [ ] Previous test can cover this change.
           - [ ] No code files have been changed.
           - [ ] Other reason <!-- Add your reason?  -->
   
   - Behavior changed:
       - [ ] No.
       - [x] Yes. <!-- Explain the behavior change -->
           - The table's metrics reporter receives scan reports for tables of 
Kerberos catalogs.
   
   - Does this need documentation?
       - [x] No.
       - [ ] Yes. <!-- Add document PR link here. eg: 
https://github.com/apache/doris-website/pull/1214 -->
   
   ### Check List (For Reviewer who merge this PR)
   
   - [ ] Confirm the release note
   - [ ] Confirm test cases
   - [ ] Confirm document
   - [ ] Add branch pick label <!-- Add branch pick label that this PR should 
merge into -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to