-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-28527][SQL][TEST] Enable ThriftServerQueryTestSuite #25868
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Test build #111064 has finished for PR 25868 at commit
|
|
retest this please |
|
Test build #111066 has finished for PR 25868 at commit
|
|
cc @zsxwing |
|
Test build #111144 has finished for PR 25868 at commit
|
|
Test build #111146 has finished for PR 25868 at commit
|
|
retest this please |
|
Test build #111160 has finished for PR 25868 at commit
|
|
retest this please |
|
retest this please |
|
retest this please |
|
Test build #111155 has finished for PR 25868 at commit
|
|
Test build #111162 has finished for PR 25868 at commit
|
|
Test build #111161 has finished for PR 25868 at commit
|
|
retest this please |
|
retest this please |
|
Test build #111169 has finished for PR 25868 at commit
|
|
Test build #111170 has finished for PR 25868 at commit
|
|
retest this please |
2 similar comments
|
retest this please |
|
retest this please |
|
Test build #111174 has finished for PR 25868 at commit
|
|
Test build #111179 has finished for PR 25868 at commit
|
|
retest this please |
|
Test build #111183 has finished for PR 25868 at commit
|
|
retest this please |
|
Test build #111184 has finished for PR 25868 at commit
|
|
retest this please |
|
Test build #111186 has finished for PR 25868 at commit
|
|
retest this please |
|
Test build #111234 has finished for PR 25868 at commit
|
|
So, this adds |
|
Yes. It will add |
dongjoon-hyun
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, LGTM.
|
Thank you, @wangyum . Please merge this after PST midnight to avoid Jenkins reset. |
|
Merged to master. |
|
Thank you @HyukjinKwon @dongjoon-hyun |
| override def sparkConf: SparkConf = super.sparkConf | ||
| // Hive Thrift server should not executes SQL queries in an asynchronous way | ||
| // because we may set session configuration. | ||
| .set(HiveUtils.HIVE_THRIFT_SERVER_ASYNC, false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean this is broken and the user should also turn if off? If so, should we change the default value? Otherwise, our tests are actually testing something that's rarely used.
Hive Thrift server should not executes SQL queries in an asynchronous way because we may set session configuration.
Could you clarify what's the exact issue? Is it because the background thread is missing some thread-local variables because threads are reused? Can we copy them from the parent thread here? https://github.com/apache/spark/blob/master/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkExecuteStatementOperation.scala#L186
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ur, this suite is not aiming concurrency stress test. It's just targeting SQL execution one by one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it exposes some bugs in the default mode. Seems worth to fix the bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me, that doesn't imply a bug in the default mode. That means we want to run one by one simply in this test suite.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course, if there is a bug, definitely we should fix it. But, let's not enable that in this test suite. That is completely a separate issue, isn't it? With a separate UT and a patch, that should be handled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With HiveUtils.HIVE_THRIFT_SERVER_ASYNC enabled the Thriftserver will still execute queries one by one. The difference is that it will not block the request:
- With HIVE_THRIFT_SERVER_ASYNC=false client sends a query in an TExecuteStatementReq. The query executes, and only after it finishes the server responds with a TExecuteStatementResp. Then the client calls TGetOperationStatusReq to see if the result was a success or failure, and then potentially continues fetching results...
- With HIVE_THRIFT_SERVER_ASYNC=true client sends a query in an TExecuteStatementReq, and the server starts it in a background thread and immediately returns a handle in the response. Then the client periodically polls with TGetOperationStatusReq until the query is finished, an then potentailly continues fetching results...
In both cases, the Hive JDBC driver executes one query at once and there is no concurrency.
I think this setting does not need to be set.
juliuszsompolski
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wangyum late post-review as I only now noticed this PR.
| override def sparkConf: SparkConf = super.sparkConf | ||
| // Hive Thrift server should not executes SQL queries in an asynchronous way | ||
| // because we may set session configuration. | ||
| .set(HiveUtils.HIVE_THRIFT_SERVER_ASYNC, false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With HiveUtils.HIVE_THRIFT_SERVER_ASYNC enabled the Thriftserver will still execute queries one by one. The difference is that it will not block the request:
- With HIVE_THRIFT_SERVER_ASYNC=false client sends a query in an TExecuteStatementReq. The query executes, and only after it finishes the server responds with a TExecuteStatementResp. Then the client calls TGetOperationStatusReq to see if the result was a success or failure, and then potentially continues fetching results...
- With HIVE_THRIFT_SERVER_ASYNC=true client sends a query in an TExecuteStatementReq, and the server starts it in a background thread and immediately returns a handle in the response. Then the client periodically polls with TGetOperationStatusReq until the query is finished, an then potentailly continues fetching results...
In both cases, the Hive JDBC driver executes one query at once and there is no concurrency.
I think this setting does not need to be set.
|
|
||
| override def beforeEach(): Unit = { | ||
| override def beforeAll(): Unit = { | ||
| super.beforeAll() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In an earlier PR I commented that the flakiness may be because of async issues.
I meant that calling startThriftServer actually starts some things asynchronously in the background before the server becomes ready.
Moving it to beforeAll instead of beforeEach should help the flakiness by having this race only at the start of the suite and not before every test, but I think adding a 3 or 5 s sleep would make sure it never happens.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I seem to be hitting it in the first test of the suite quite often:
[info] ThriftServerQueryTestSuite:
[info] - query_regex_column.sql *** FAILED *** (184 milliseconds)
[info] java.sql.SQLException: Could not open client transport with JDBC Uri: jdbc:hive2://localhost:15421: java.net.ConnectException: Connection refused (Connection refused)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pgSQL/text.sql should fail if spark.sql.hive.thriftServer.async is enabled: #25567 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyway, let's try to enable it: #26172
What changes were proposed in this pull request?
This PR enable
ThriftServerQueryTestSuiteand fix previously flaky test by:beforeAll().spark.sql.hive.thriftServer.async.Why are the changes needed?
Improve test coverage.
Does this PR introduce any user-facing change?
No.
How was this patch tested?