Table schema cache and schema change event use different table names, the later with user_ prefix

Bug #1301030 reported by Charles Wang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MagnetoDB
Fix Released
Medium
Charles Wang

Bug Description

The schema change event reflects the real table name (with user_ prefix) while the table schema cache uses the table name without user_ prefix.

    def schema_change_listener(self, event):
        LOG.debug("Schema change event captured: %s" % event)

        tenant = event.get('keyspace')
        table_name = event.get('table')

        if (tenant is None) or (table_name is None):
            return

        if event['change_type'] == "DROPPED":
            self._remove_table_schema_from_cache(tenant, table_name)

Should be changed to:

    def schema_change_listener(self, event):
        LOG.debug("Schema change event captured: %s" % event)

        tenant = event.get('keyspace')
        table_name = event.get('table')[len(self.USER_TABLE_PREFIX):]

        if (tenant is None) or (table_name is None):
            return

        if event['change_type'] == "DROPPED":
            self._remove_table_schema_from_cache(tenant, table_name)

Changed in magnetodb:
assignee: nobody → Charles Wang (charles-wang)
Changed in magnetodb:
milestone: none → 2.0.5
importance: Undecided → Medium
Revision history for this message
Dmitriy Ukhlov (dukhlov) wrote :

Charles, is this bug out of date after storage level refactoring for async tables? Because now schema change listener was removed at all

Revision history for this message
Charles Wang (charles-wang) wrote :

Yes it's no longer valid. Let's close the bug since the function has been removed.

Changed in magnetodb:
status: New → Fix Committed
Revision history for this message
Charles Wang (charles-wang) wrote :

Changed to fix committed since the buggy code was removed.

Changed in magnetodb:
status: Fix Committed → Fix Released
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.