Skip to content

Commit 9220be8

Browse files
i18nsitegrooverdan
authored andcommitted
MDEV-36010 - fix myrocks_hotbackup for python3
python collections.OrderedDict removed iteritems see https://peps.python.org/pep-0469/ myrocks_hotbackup --move_back --datadir=$DATADIR --rocksdb_datadir="$DATADIR/#rocksdb" --rocksdb_waldir=$DATADIR --backup_dir=/tmp/myrocks.bak 2024-11-13 14:00:35.415 ERROR Directory /mnt/data/i18n/mariadb/data has file or directory #rocksdb!
1 parent 7374546 commit 9220be8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

storage/rocksdb/myrocks_hotbackup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ def do_backup_until(self, time_limit):
268268
start_time= time.time()
269269
last_progress_time= start_time
270270
progress_size= 0
271-
for fname, size in self.target_sst.iteritems():
271+
for fname, size in self.target_sst.items():
272272
self.do_backup_sst(fname, size)
273273
progress_size= progress_size + size
274274
elapsed_seconds = time.time() - start_time
@@ -319,11 +319,13 @@ def connect(user, password, port, socket=None):
319319
if socket:
320320
dbh = MySQLdb.Connect(user=user,
321321
passwd=password,
322+
charset='utf8',
322323
unix_socket=socket)
323324
else:
324325
dbh = MySQLdb.Connect(user=user,
325326
passwd=password,
326327
port=port,
328+
charset='utf8',
327329
host="127.0.0.1")
328330
return dbh
329331

@@ -645,8 +647,8 @@ def move_back():
645647
print_move_back_usage()
646648
sys.exit()
647649
create_moveback_dir(opts.datadir)
648-
create_moveback_dir(opts.rocksdb_datadir)
649650
create_moveback_dir(opts.rocksdb_waldir)
651+
create_moveback_dir(opts.rocksdb_datadir)
650652

651653
os.chdir(opts.backupdir)
652654
for f in os.listdir(opts.backupdir):

0 commit comments

Comments
 (0)