Bug #59277 Queries not binary logged produce a Warning when anyValue is used
Submitted: 4 Jan 2011 12:23 Modified: 21 Jan 2011 16:48
Reporter: Geert Vanderkelen Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:mysql-5.1.51-ndb-7.1.9 OS:Any
Assigned to: Frazer Clement CPU Architecture:Any

[4 Jan 2011 12:23] Geert Vanderkelen
Description:
A Warning message is issued when anyValue is used by NDBAPI application (makeing sure the changes are not logged to the binary log). This will flood the error log of MySQL needlessly.

How to repeat:
See source code in sql/ha_ndbcluster_binlog.cc:

static void ndb_binlog_query(THD *thd, Cluster_schema *schema)
{
  /* any_value == 0 means local cluster sourced change that
   * should be logged
   */
  if (ndbcluster_anyvalue_is_reserved(schema->any_value))
  {
    /* Originating SQL node did not want this query logged */
    if (!ndbcluster_anyvalue_is_nologging(schema->any_value))
      sql_print_warning("NDB: unknown value for binlog signalling 0x%X, "
                        "query not logged",
                        schema->any_value);
    return;
  }
  ..

Suggested fix:
Remove the Warning message or show it only when debugging?
Also, typo in 'signalling' :)
[21 Jan 2011 16:45] Frazer Clement
Prior to the introduction of the --server-id-bits option, the AnyValue for nologging was 0xffffffff.  This would cause the event in question not to be logged, but there was no scope for 'application data' to also be transported to subscribers in the AnyValue.

The top bit set (0x8...) indicates that *the rest of the value* is reserved. (0x80000000 to 0xffffffff).  All bits set in the rest of the value is the nologging code, all other codes were invalid.

With the introduction of --server-id-bits, only the bottom 7 lsbs are reserved and examined when the top bit is set, e.g.

0x80000000 to 0x8000007f.

Up to 24 bits in the middle are available for applications, and will be ignored by the MySQLD code.

Of the 128 reserved values, only one, with all bits set, is used for NoLogging.

e.g. : 0x8000007f.

The use of other reserved values in these bottom bits generates the warning,

The value of the middle 24 bits is ignored by this code.

So suggest that applications are modified to use AnyValues in the ranges :

0 -> 0x7fffffff
and values above
0x80000000 as long as the bottom 7 bits are set to the NoLogging value 0x7f.

Applications should only set the top bit (and bottom 7 lsbs) if they want events to not be logged.