diff --git a/SETUP.md b/SETUP.md index 5ab4ea542..e3988e9b8 100644 --- a/SETUP.md +++ b/SETUP.md @@ -173,13 +173,27 @@ curl "${curlArgs[@]}" -XGET http://localhost:8000/v1/databases/d3/tables/t1 #### Update a Table +The PUT request requires two values from a prior GET response: + +- **`baseTableVersion`** — use the `tableVersion` field from GET (after the first update this becomes a metadata file path, not `"INITIAL_VERSION"`) +- **`tableProperties`** — must include all `openhouse.*` properties from the GET response merged with any user-defined properties; omitting them causes a 500 in the server's cross-cluster eligibility check + +First GET the current state: + +``` +curl "${curlArgs[@]}" -XGET http://localhost:8000/v1/databases/d3/tables/t1 +``` + +Then PUT with the returned `tableVersion` and `tableProperties`: + ``` curl "${curlArgs[@]}" -XPUT http://localhost:8000/v1/databases/d3/tables/t1 \ --data-raw '{ "tableId": "t1", "databaseId": "d3", - "baseTableVersion": - "clusterId": "", + "clusterId": "", + "tableType": "PRIMARY_TABLE", + "baseTableVersion": "", "schema": "{\"type\": \"struct\", \"fields\": [{\"id\": 1,\"required\": true,\"name\": \"id\",\"type\": \"string\"},{\"id\": 2,\"required\": true,\"name\": \"name\",\"type\": \"string\"},{\"id\": 3,\"required\": true,\"name\": \"ts\",\"type\": \"timestamp\"}, {\"id\": 4,\"required\": true,\"name\": \"country\",\"type\": \"string\"}]}", "timePartitioning": { "columnName": "ts", @@ -191,6 +205,7 @@ curl "${curlArgs[@]}" -XPUT http://localhost:8000/v1/databases/d3/tables/t1 \ } ], "tableProperties": { + "": "...", "key": "value" } }' diff --git a/buildSrc/src/main/groovy/openhouse.springboot-conventions.gradle b/buildSrc/src/main/groovy/openhouse.springboot-conventions.gradle index 8cc60564e..eb50d0b1f 100644 --- a/buildSrc/src/main/groovy/openhouse.springboot-conventions.gradle +++ b/buildSrc/src/main/groovy/openhouse.springboot-conventions.gradle @@ -18,6 +18,11 @@ configurations { // Standardizing on slf4j + log4j2 as implementation. all*.exclude module : 'spring-boot-starter-logging' all*.exclude module : 'logback-classic' + // Exclude Log4j 1.x and its SLF4J bridge so Hadoop transitive deps don't introduce + // a competing SLF4J binding alongside log4j-slf4j-impl. log4j-1.2-api below provides + // the Log4j 1.x API compatibility layer that routes to Log4j2 instead. + all*.exclude group: 'org.slf4j', module: 'slf4j-log4j12' + all*.exclude group: 'log4j', module: 'log4j' } dependencies { @@ -25,6 +30,11 @@ dependencies { api 'org.springframework.boot:spring-boot-starter-web:' + springVersion implementation 'org.springframework.boot:spring-boot-starter-log4j2:' + springLog4jVersion + // Bridge Log4j 1.x API calls (from Hadoop) to Log4j2, completing the logging unification. + // With slf4j-log4j12 and log4j:log4j excluded above, this is the sole provider of the + // Log4j 1.x API and routes all calls through Log4j2, making them visible to Spring + // Boot Actuator's /actuator/loggers endpoint. + implementation 'org.apache.logging.log4j:log4j-1.2-api:2.25.3' api 'org.springframework.boot:spring-boot-starter-actuator:2.7.8' api 'org.springframework.boot:spring-boot-starter-validation:' + springVersion annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor:' + springVersion diff --git a/services/tables/src/main/resources/application.properties b/services/tables/src/main/resources/application.properties index d6cfaa5d5..beda2746b 100644 --- a/services/tables/src/main/resources/application.properties +++ b/services/tables/src/main/resources/application.properties @@ -12,11 +12,12 @@ server.tomcat.accesslog.enabled=true server.tomcat.accesslog.rename-on-rotate=false server.tomcat.accesslog.request-attributes-enabled=false server.tomcat.accesslog.rotate=true -management.endpoints.web.exposure.include=health, shutdown, prometheus, beans +management.endpoints.web.exposure.include=health, shutdown, prometheus, beans, loggers management.endpoint.health.enabled=true management.endpoint.shutdown.enabled=true management.endpoint.prometheus.enabled=true management.endpoint.beans.enabled=true +management.endpoint.loggers.enabled=true management.metrics.distribution.percentiles-histogram.all=true management.metrics.distribution.maximum-expected-value.catalog_metadata_retrieval_latency=600s server.shutdown=graceful