mikeizbicki / cmc-csci143

big data course materials
40 stars 76 forks source link

lab- same issue as in-person lab #475

Closed giffiecode closed 8 months ago

giffiecode commented 8 months ago

after redoing the lab, I still run into the issue that it shows 0 transaction instead of something around 1500.

postgres=# SELECT count(*) FROM transactions
;
 count 
-------
     0
(1 row)

I noticed that when I run the chaosmonkey_parallel script, the error below occured.

scripts/chaosmonkey_parallel.sh: 23: kill: No such process

scripts/chaosmonkey_parallel.sh: 23: kill: No such process

scripts/chaosmonkey_parallel.sh: 23: kill: No such process

scripts/chaosmonkey_parallel.sh: 23: kill: No such process

scripts/chaosmonkey_parallel.sh: 23: kill: No such process

scripts/chaosmonkey_parallel.sh: 23: kill: No such process

scripts/chaosmonkey_parallel.sh: 23: kill: No such process

The below is the lock I've added to the Ledger/__init__.py file

with self.connection.begin():
            # lock the balances table
            sql = f'LOCK TABLE balances IN EXCLUSIVE MDOE'
            logging.debug(sql)
            self.connection.execute(sql)

please let me know if there's anything wrong with my approach to the lock

giffiecode commented 8 months ago

this is resolved