Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-12370

Rely on the metadata file in the Workgen mirror validation script

    • Storage Engines
    • 5
    • 2024-02-20_A_near-death_puffin

      Testy script that validates the table has failed under snapshot ID snap-001b76b801cc0b334

      Traceback (most recent call last):
        File "/srv/testy/wiredtiger/bench/workgen/validate_mirror_tables.py", line 142, in <module>
          main(sys.argv[1:])
        File "/srv/testy/wiredtiger/bench/workgen/validate_mirror_tables.py", line 116, in main
          mirrors = get_mirrors(db_dir, db_files)
        File "/srv/testy/wiredtiger/bench/workgen/validate_mirror_tables.py", line 66, in get_mirrors
          mirror_filename = get_mirror_file(db_dir, f'table:{filename}')
        File "/srv/testy/wiredtiger/bench/workgen/validate_mirror_tables.py", line 87, in get_mirror_file
          metadata = c[filename]
        File "/srv/testy/wiredtiger/build/lang/python/wiredtiger/swig_wiredtiger.py", line 328, in __getitem__
          raise KeyError
      KeyError
      

      Error has happened here within the code:

      # Get the mirror for the specified file by examining the file's metadata. Mirror names
      # are stored in the 'app_metadata' by workgen when mirroring is enabled. If the file has
      # a mirror, the name of the mirror is returned. Otherwise, the function returns None.
      def get_mirror_file(db_dir, filename):
      
          connection = wiredtiger_open(db_dir, 'readonly')
          session = connection.open_session()
          c = session.open_cursor('metadata:', None, None)
          metadata = c[filename]
          c.close()
      
          result = re.findall('app_metadata="([^"]*)"', metadata)
          mirror = None
      
          if result:
              app_metadata = dict((a.strip(), b.strip())
                  for a, b in (element.split('=')
                      for element in result[0].split(',')))
      
              if app_metadata.get('workgen_dynamic_table') == 'true' and \
                 app_metadata.get('workgen_table_mirror') != None :
                  mirror = app_metadata['workgen_table_mirror']
                  mirror = mirror.split(':')[1]
      
          session.close()
          connection.close()
          return mirror
      

      The problem seems to be that we are not able to find the specific mirror file within the directory. A quick scan of the data directory shows that all the mirror tables exist.

            Assignee:
            etienne.petrel@mongodb.com Etienne Petrel
            Reporter:
            jie.chen@mongodb.com Jie Chen
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: