Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions changelog/unreleased/solr-18343-explicit-admin-methods.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
title: >
SolrJ v1 admin requests now use appropriate HTTP verbs -- mostly POST, some GET
type: changed
authors:
- name: Xinyao Zhang
links:
- name: SOLR-18343
url: https://issues.apache.org/jira/browse/SOLR-18343

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is strange... why would these have changed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. After switching to POST, the action is no longer in the query string, so tracing was falling back to the HTTP method. I’ve updated it to use the parsed request params instead, which keeps the action names in these spans.

Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ private void verifyCollectionCreation(String collection) throws Exception {
assertEquals(0, r1.getStatus());

// Expecting 8 spans:
// 1. api call "name=create:/admin/collections". db.instance=testInternalCollectionApiCommands
// 1. api call "name=post:/admin/collections". db.instance=testInternalCollectionApiCommands
// - unique traceId unrelated to the internal trace id generated for the operation
// 2. internal CollectionApiCommand "name=CreateCollectionCmd"
// db.instance=testInternalCollectionApiCommands
Expand All @@ -222,7 +222,7 @@ private void verifyCollectionCreation(String collection) throws Exception {
var finishedSpans = getAndClearSpans(1);
var s0 = finishedSpans.remove(0);
assertCollectionName(s0, collection);
assertEquals("create:/admin/collections", s0.getName());
assertEquals("post:/admin/collections", s0.getName());

Map<String, Integer> ops = new HashMap<>();
assertEquals(11, finishedSpans.size());
Expand All @@ -248,7 +248,7 @@ private void verifyCollectionDeletion(String collection) throws Exception {
assertEquals(0, r1.getStatus());

// Expecting 6 spans:
// 1. api call "name=delete:/admin/collections". db.instance=testInternalCollectionApiCommands
// 1. api call "name=post:/admin/collections". db.instance=testInternalCollectionApiCommands
// - unique traceId unrelated to the internal trace id generated for the operation
// 2. internal CollectionApiCommand "name=DeleteCollectionCmd"
// db.instance=testInternalCollectionApiCommands
Expand All @@ -263,7 +263,7 @@ private void verifyCollectionDeletion(String collection) throws Exception {
var finishedSpans = getAndClearSpans(1);
var s0 = finishedSpans.remove(0);
assertCollectionName(s0, collection);
assertEquals("delete:/admin/collections", s0.getName());
assertEquals("post:/admin/collections", s0.getName());

Map<String, Integer> ops = new HashMap<>();
assertEquals(5, finishedSpans.size());
Expand Down
Loading
Loading