Skip to content
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

HPCC-30429 Fix WsECL display for 'Create Workunit' option #17887

Merged
merged 1 commit into from
Nov 6, 2023

Conversation

wangkx
Copy link
Member

@wangkx wangkx commented Oct 11, 2023

The 'Create Workunit' option should not be available for a queriesOnly roxie.

Type of change:

  • This change is a bug fix (non-breaking change which fixes an issue).
  • This change is a new feature (non-breaking change which adds functionality).
  • This change improves the code (refactor or other change that does not change the functionality)
  • This change fixes warnings (the fix does not alter the functionality or the generated code)
  • This change is a breaking change (fix or feature that will cause existing behavior to change).
  • This change alters the query API (existing queries will have to be recompiled)

Checklist:

  • My code follows the code style of this project.
    • My code does not create any new warnings from compiler, build system, or lint.
  • The commit message is properly formatted and free of typos.
    • The commit message title makes sense in a changelog, by itself.
    • The commit is signed.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly, or...
    • I have created a JIRA ticket to update the documentation.
    • Any new interfaces or exported functions are appropriately commented.
  • I have read the CONTRIBUTORS document.
  • The change has been fully tested:
    • I have added tests to cover my changes.
    • All new and existing tests passed.
    • I have checked that this change does not introduce memory leaks.
    • I have used Valgrind or similar tools to check for potential issues.
  • I have given due consideration to all of the following potential concerns:
    • Scalability
    • Performance
    • Security
    • Thread-safety
    • Cloud-compatibility
    • Premature optimization
    • Existing deployed queries will not be broken
    • This change fixes the problem, not just the symptom
    • The target branch of this pull request is appropriate for such a change.
  • There are no similar instances of the same problem that should be addressed
    • I have addressed them here
    • I have raised JIRA issues to address them separately
  • This is a user interface / front-end modification
    • I have tested my changes in multiple modern browsers
    • The component(s) render as expected

Smoketest:

  • Send notifications about my Pull Request position in Smoketest queue.
  • Test my draft Pull Request.

Testing:

@github-actions
Copy link

@wangkx wangkx requested a review from afishbeck October 11, 2023 15:47
Copy link
Member

@afishbeck afishbeck left a comment

Choose a reason for hiding this comment

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

@wangkx one comment on naming, otherwise looks good.

@@ -2134,8 +2139,18 @@ void CWsEclBinding::sendRoxieRequest(const char *target, StringBuffer &req, Stri
}
}

static void checkForceCreateWorkunit(IEspContext &context, bool forceCreateWorkunit)
Copy link
Member

Choose a reason for hiding this comment

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

@wangkx I think I now regret the flag being called "forceCreateWorkunit". So for the check method maybe we can use a better name. Perhaps "checkWorkunitCompatibleOptions()"? And just for this function you can use a different name for the flag.. "bool submitWorkunit"?

bool statsToWorkunit = context.queryRequestParameters()->getPropBool("@statsToWorkunit", false);
bool summaryStats = context.queryRequestParameters()->getPropBool("@summaryStats", false);
if (forceCreateWorkunit && (statsToWorkunit || summaryStats))
throw makeStringException(-1, "Both 'Save stats to workunit' and 'Get summary stats' are not supported for the 'Create Workunit' option");
Copy link
Member

Choose a reason for hiding this comment

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

Also perhaps "Neither 'Save stats to workunit' or 'Get summary stats' are supported for the 'Create Workunit' option".

The 'Create Workunit' option should not be available for a
queriesOnly roxie.

Signed-off-by: wangkx <[email protected]>
Copy link
Member

@afishbeck afishbeck left a comment

Choose a reason for hiding this comment

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

@wangkx looks good.

@wangkx
Copy link
Member Author

wangkx commented Oct 11, 2023

@ghalliday looks like the failure of the Docker smoketest build is not related. Please merge.

Copy link
Member

@ghalliday ghalliday left a comment

Choose a reason for hiding this comment

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

@wangkx a couple of questions.

@@ -311,7 +311,7 @@ function switchInputForm()
</span>
</td>
</tr>
<xsl:if test="$includeRoxieOptions=1">
<xsl:if test="$includeRoxieOptions=1 or $includeRoxieOptions=2">
Copy link
Member

Choose a reason for hiding this comment

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

Should this be != 0? Currently 3 is not included.

Copy link
Member Author

Choose a reason for hiding this comment

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

The 3 is not included here because it is for a roxie which always runs a published query as a workunit. The 'Save stats to workunit.' option and 'Get summary stats.' option should not give to that roxie. @afishbeck please comment.

Copy link
Member

Choose a reason for hiding this comment

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

I asked because the code on line 348 will never be processed as it stands.

Also, is the traceLevel check-box still relevant?

Copy link
Member Author

@wangkx wangkx Oct 13, 2023

Choose a reason for hiding this comment

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

The includeRoxieOptions will be set to 3 in the code of esp/services/ws_ecl/ws_ecl_service.cpp for a workunit roxie. In that case, the line 348 will be processed.

Also, is the traceLevel check-box still relevant?

I am not sure. @afishbeck please advise.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, when calling a published query you can tell Roxie the traceLevel to use. I’m not sure if there is an equivalent work unit parameter. As it is now that shouldn’t be exposed when submitting a work unit.

VStringBuffer xpath("queues[@name='%s']", wuinfo.qsetname.get());
IPropertyTree *queue = getComponentConfigSP()->queryPropTree(xpath.str());
if (queue && strieq(queue->queryProp("@type"), "roxie"))
xform->setParameter("includeRoxieOptions", queue->getPropBool("@queriesOnly") ? "2" : "3");
Copy link
Member

Choose a reason for hiding this comment

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

@afishbeck is this correct. Does queriesOnly imply that you cannot deploy a query? Should it return "1" or "3"?

Copy link
Member

Choose a reason for hiding this comment

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

Deploying a query isn't the right term here.

In k8s we separated out the roxies that would listen on a workunit queue to run workunits.

So for queriesOnly, you can deploy a query and then send it xml/json/testsocket requests. But you can't submit and run workunits.

The opposites is also currently true. Roxie-workunit components are setup like eclagents and you can't deploy queries to them.

Roxie itself supports mixed mode so we could easily change that or make it an option (if the option isn't already there) on the roxie side. We may need a new flag to specify mixed mode in the config so that this code and other places can know the difference though.

@wangkx
Copy link
Member Author

wangkx commented Nov 2, 2023

@ghalliday sorry, I missed this PR. Should this PR be merged or you have more comment?

@wangkx wangkx requested a review from ghalliday November 2, 2023 20:01
Copy link
Member

@ghalliday ghalliday left a comment

Choose a reason for hiding this comment

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

I will approve.

@ghalliday ghalliday merged commit fe84961 into hpcc-systems:candidate-9.4.x Nov 6, 2023
49 of 50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants