Query Cancel does not work for DDL statements and utility statements

Bug #1404963 reported by Chong Hsu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Trafodion
Fix Committed
High
Mike Hanlon

Bug Description

Cancel Broker has been implemented for DML queries, but DDL statements and utility statements (UPDATE STATISTICS, LOAD, MAINTAIN) are not supported yet.

Tags: sql-exe
Changed in trafodion:
milestone: r1.0 → r1.1
Revision history for this message
Mike Hanlon (mike-hanlon) wrote :

A DDL statement which is not protected by transactions may leave inconsistencies when it is canceled. For example, if CREATE INDEX is canceled, it can leave the index defined in the metadata even though the statement returns an error. This problem will be addressed by the blueprint Support for SQL ddl operations within transactions. https://blueprints.launchpad.net/trafodion/+spec/dtm-ddl-support .

The fix for this bug will not address atomicity of CREATE INDEX or other DDL operations.

Revision history for this message
Mike Hanlon (mike-hanlon) wrote :

I forgot to reference this bug in yesterday's commit. Here is the message:

Support cancel for DDL, update stats, and utils

This change propagates parent query ID to queries created
by DDL, update stats and utils. In this way, preexisting
code sets up child query IDs and the preexisting cancel
broker code in RMS cancels the entire query tree below
the indicated parent. Also added is logic to check for a
canceled parent at the time a child query ID is setup in
Statement::execute, to make the scheme more robust and
to support a common scenario where the parent is compiling
a child query at the time of cancel.
This change also makes ex_root_tcb::cancel to wait for
cancel broker message completion. This fixes a problem where
a query (e.g., CREATE INDEX or DROP INDEX) is prepared,
executed once and gets an error, then re-execed. In this
case, sqlci was not closing the statement after the error.
To improve robustness, after an error we will now wait for
message completion, if needed.
Since we do not yet have transaction protection for DDL,
it will usually be required to cleanup canceled DDL
operations by using the CLEANUP command.

Change-Id: I8940f7108906d5d8d1a8aa4574aacf2b9ffcf0b6

Changed in trafodion:
status: New → Fix Committed
Revision history for this message
Mike Hanlon (mike-hanlon) wrote :

We discovered the child & parent query IDs were not being set properly for UPDATE STATISTICS. So I'm reopening this bug to cover the work of getting this fixed.

Changed in trafodion:
status: Fix Committed → In Progress
Revision history for this message
Trafodion-Gerrit (neo-devtools) wrote : Fix proposed to core (master)

Fix proposed to branch: master
Review: https://review.trafodion.org/1384

Revision history for this message
Trafodion-Gerrit (neo-devtools) wrote : Fix merged to core (master)

Reviewed: https://review.trafodion.org/1384
Committed: https://github.com/trafodion/core/commit/e871e1221c0615028c1c64b15a49c33c9a6fe59e
Submitter: Trafodion Jenkins
Branch: master

commit e871e1221c0615028c1c64b15a49c33c9a6fe59e
Author: Mike Hanlon <email address hidden>
Date: Wed Mar 25 21:59:42 2015 +0000

    Fix child/parent query IDs for update stats

    Failure to setup child/parent query IDs for update stats and
    other non-embedded compiler scenarios caused problems in cancel
    including frequest but intermittent failure of executor/TEST106.
    This change fixes the problem.

    Change-Id: I0d6b80aeddf9906f08d3dab09f9775414ea7bfc3
    Closes-Bug: #1404963

Changed in trafodion:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.