Postgres is a database software that powers a large number of production databases around the world including Indian Kanoon. Postgres 9.0 was recently released after more than a year and half of development. The version number was jumped from 8.4 (the previous release) to 9.0 considering the inclusion of two important features namely Streaming Replication and Hot Standby.
Streaming replication, as the name implies, allows a database administer to replicate a primary database on multiple secondary nodes. So when the primary database dies due to hardware failure or software error, one of the secondary nodes can become the primary database to serve production queries. Previously, to replicate a postgres database, one has to copy the base directoy and then periodically copy the Write-Ahead-Log (WAL) of the database. Then the secondary node would run in a continuous recovery process reading the WAL. As the secondary database was still recovering, it could not be used for querying. As such previous standby nodes were called "Warm-Standby".
The WAL shipping happened at time outs or when a WAL segment was full. And so the secondary database could be significantly behind the master in seeing the WAL. Streaming replication fills that gap now. It does not wait anymore for the filling of WAL segments as it "streams them directly" to the secondary server on a TCP connection. Note that currently streaming replication only allows asynchronous transaction, which means that a database transaction need not wait for the replication to finish. So there is a small window of time in which a transaction committed on primary database is not replicated on the secondary and the primary crashes.
The Hot-Standby feature allows read-only queries on a standby node. Previously, a standby was not good for anything other than waiting for the primary to crash. Now the standby can serve production queries as well while keeping the secondary database up to date with the primary. This is tremendously useful as read-only database queries can be load balanced on primary as well as secondary.
I had lot of fun trying to play around with making these two features work for Indian Kanoon databases. I followed the wiki doggedly for setting up streaming replication. However, unable to replicate a dog, I would miss something or the other and the thing will not turn up. In the end the Indian Kanoon database was successfully replicated in a hot-standby mode on an another server in the same data center. It has to be noted that data transfer with in the data-center was clocking close to half a gigabit per second that reminds me of the old 100Mbps networking cards that are obsolete now.
Here are the final steps I took:
1. Modified postgresql.conf on the primary node with following changes:
a. wal_level = hot_standby # sets up wal replaying on a TCP socket
b. max_wal_senders = 1 # max number of walsender processes
c. wal_keep_segments = 128 # in logfile segments, 16MB each
d. listen_addresses = '*' # opens up port 5432 for postgres database server
2. Modify pg_hba.conf to include the ACL for secondary node. Add the following line:
host replication postgres secondary_node/32 trust
3. Copying the base database. On the primary node:
a. psql -c "SELECT pg_start_backup('label', true)"
b. rsync -avz --progress ${PGDATA} secondary:/home/postgres/
c. psql -c "SELECT pg_stop_backup()"
4. Setting the secondary node:
a. Modify postgresql.conf to include "hot_standby = on"
b. Created a recovery.conf on the secondary node with following changes:
i) standby_mode = 'on'
ii) primary_conninfo = 'host=indiankanoon.org'
iii) trigger_file = '/path_to/trigger'
c. Start the database and check the server log
Sunday, October 3, 2010
Friday, August 6, 2010
Media - Be educative and not sensational
Discussion with Shahab Nayyer:
TimesOfIndia article No conviction for mere demand of dowry: Supreme Courtis flatly wrong in the title. The judgment is here - http://indiankanoon.org/doc/1330427/
SC has convicted husband for "dowry death" (Section 304B of IPC) and said that there is no solid evidence of harassment from fathe...r/mother-in-law to convict under section 304B or section 498A. You need evidence of harassment before convicting under those sections.
For mere demand of dowry, there is section 4 in the Dowry Prohibition act http://indiankanoon.org/doc/1023340/ for which maximum punishment is imprisonment up to 6 months. That is not the same as life term imprisonment under Section 304B. So the prosecution need to move another petition for Section 4 of DPA which they have not done earlier.
SHAHAB NAYYER: Had my doubts about the TOI title too.. They are big on sensationalism. Thanks for clearing that.
I also read through the whole judgment and the relevant sections of law but I think judge was very lenient. He even reduced the sentence of th...e husband to 10 yrs.
Based on the info in judgment I don't think there was very strong evidence against anyone. Most of the evidence was just testimonies, no forensic or any sort of corroborative evidence specifically pinning down the accused. Given the poor state of police and investigative agencies, I am not sure we will see that day any time soon though. Due to the sensitive nature of relationship people tend to keep things to them to the extent possible, so testimonies are also generally from close relative who may not be independent.
The only difference in evidence seems to be in the nuances of how the witnesses uttered their testimonies for the three parties. For In-laws it was just harassment but for the husband PW-4 had given an example also "taunt her that she has come from a hungry house". To me this is simply a case of the witness not knowing the nuances of law and adding the right keyword.
The other reason the judge cites is judicial precedent that stronger evidence is needed for in-laws than husband. Judges better know how to use this but with dowry still being a social menace; personally I would feel better if these things are used for giving lesser punishment than for letting them totally free.
Is there anything in the law that stopped the judge for punishing in-laws under “section 4 in the Dowry Prohibition act “without the prosecution specifically asking for it? There may very well be some technicality. Otherwise it seems that prosecution was aiming for stricter punishment; the judge wasn’t convinced and let them totally free.
FYI: I have seen at some place a slightly different version of section 4 in the Dowry Prohibition act which states the punishment as “shall not be less than six months but which may extend to two years and with fine which may extend to ten thousand rupees”. Not sure what is the source of this discrepancy.
http://wcd.nic.in/dowryprohibitionact.htm
SUSHANT SINHA: Under section 304B, punishment ranges from 7 yrs to life imprisonment. I do not know how they decide what number in between. So that is something that needs to be looked at. An amendment was made to CrPC that has a presumption of guilt in c...ase of dowry death. It only needs to have certain conditions and then the death as sufficient for conviction, So the prosecution need not demonstrate the evidence "beyond reasonable doubt" as required in a murder.
I think the judge can take "suo moto" cognizance of certain issues. But I rarely see judges passing order on charges that are not levelled and they ask to file a separate case.
Acts on IK are a copy of what law ministry provides on indiacode. However, they have not added the amendments in last 10 yrs to the acts. So the source of discrepancy most likeyly is the staleness of the DPA on IK.
SHAHAB NAYYER: Do you think many people file new cases in examples like this and is this adding to the delay in any significant way ?
about an hour ago · LikeUnlike ·
SUSHANT SINHA: Criminal case is not prosecuted by individuals. It is always "State of Gujarat" or "State of India" depending on the nature of the crime. A lot of factors add to the delay. My feeling is that our high courts and supreme court review almost every decision of the lower court. And that adds up to the pile up of cases in these courts. If you see, SC in US only reviews 1-2% of the federal court decisions. In India this rate is very high.
SUSHANT SINHA: An interesting article by Nick Robinson on Frontline:
http://www.frontlineonnet.com/fl2601/stories/20090116260108100.htm
And his blog post:
...http://lawandotherthings.blogspot.com/2009/01/changing-role-of-supreme-court-response.html
See More
SUSHANT SINHA: On why SC in India should be accepting more cases:
http://lawandotherthings.blogspot.com/2009/01/robinson-reddy-exchange-on-supreme.html
TimesOfIndia article No conviction for mere demand of dowry: Supreme Courtis flatly wrong in the title. The judgment is here - http://indiankanoon.org/doc/1330427/
SC has convicted husband for "dowry death" (Section 304B of IPC) and said that there is no solid evidence of harassment from fathe...r/mother-in-law to convict under section 304B or section 498A. You need evidence of harassment before convicting under those sections.
For mere demand of dowry, there is section 4 in the Dowry Prohibition act http://indiankanoon.org/doc/1023340/ for which maximum punishment is imprisonment up to 6 months. That is not the same as life term imprisonment under Section 304B. So the prosecution need to move another petition for Section 4 of DPA which they have not done earlier.
SHAHAB NAYYER: Had my doubts about the TOI title too.. They are big on sensationalism. Thanks for clearing that.
I also read through the whole judgment and the relevant sections of law but I think judge was very lenient. He even reduced the sentence of th...e husband to 10 yrs.
Based on the info in judgment I don't think there was very strong evidence against anyone. Most of the evidence was just testimonies, no forensic or any sort of corroborative evidence specifically pinning down the accused. Given the poor state of police and investigative agencies, I am not sure we will see that day any time soon though. Due to the sensitive nature of relationship people tend to keep things to them to the extent possible, so testimonies are also generally from close relative who may not be independent.
The only difference in evidence seems to be in the nuances of how the witnesses uttered their testimonies for the three parties. For In-laws it was just harassment but for the husband PW-4 had given an example also "taunt her that she has come from a hungry house". To me this is simply a case of the witness not knowing the nuances of law and adding the right keyword.
The other reason the judge cites is judicial precedent that stronger evidence is needed for in-laws than husband. Judges better know how to use this but with dowry still being a social menace; personally I would feel better if these things are used for giving lesser punishment than for letting them totally free.
Is there anything in the law that stopped the judge for punishing in-laws under “section 4 in the Dowry Prohibition act “without the prosecution specifically asking for it? There may very well be some technicality. Otherwise it seems that prosecution was aiming for stricter punishment; the judge wasn’t convinced and let them totally free.
FYI: I have seen at some place a slightly different version of section 4 in the Dowry Prohibition act which states the punishment as “shall not be less than six months but which may extend to two years and with fine which may extend to ten thousand rupees”. Not sure what is the source of this discrepancy.
http://wcd.nic.in/dowryprohibitionact.htm
SUSHANT SINHA: Under section 304B, punishment ranges from 7 yrs to life imprisonment. I do not know how they decide what number in between. So that is something that needs to be looked at. An amendment was made to CrPC that has a presumption of guilt in c...ase of dowry death. It only needs to have certain conditions and then the death as sufficient for conviction, So the prosecution need not demonstrate the evidence "beyond reasonable doubt" as required in a murder.
I think the judge can take "suo moto" cognizance of certain issues. But I rarely see judges passing order on charges that are not levelled and they ask to file a separate case.
Acts on IK are a copy of what law ministry provides on indiacode. However, they have not added the amendments in last 10 yrs to the acts. So the source of discrepancy most likeyly is the staleness of the DPA on IK.
SHAHAB NAYYER: Do you think many people file new cases in examples like this and is this adding to the delay in any significant way ?
about an hour ago · LikeUnlike ·
SUSHANT SINHA: Criminal case is not prosecuted by individuals. It is always "State of Gujarat" or "State of India" depending on the nature of the crime. A lot of factors add to the delay. My feeling is that our high courts and supreme court review almost every decision of the lower court. And that adds up to the pile up of cases in these courts. If you see, SC in US only reviews 1-2% of the federal court decisions. In India this rate is very high.
SUSHANT SINHA: An interesting article by Nick Robinson on Frontline:
http://www.frontlineonnet.com/fl2601/stories/20090116260108100.htm
And his blog post:
...http://lawandotherthings.blogspot.com/2009/01/changing-role-of-supreme-court-response.html
See More
SUSHANT SINHA: On why SC in India should be accepting more cases:
http://lawandotherthings.blogspot.com/2009/01/robinson-reddy-exchange-on-supreme.html
Thursday, August 5, 2010
Kashmir Secessionist's - Wake up Ass-holes!
I am sure many of you would be full of disgust for the opinion I have on Kashmir Secessionist's. But I am more disgusted with all those people who have been arguing that Kashmir should secede from India. You may think that I am just another Indian supporter who does not understand the reality of Kashmir. However, before you think that you have understood me, it is important to listen to my view point.
Some people are arguing that Indian Government has lost moral authority to rule over Kashmir valley and that is why Kashmir should be accepted as an independent state or become a part of Pakistan. However, if we put a bar as a high as "the moral authority" for determining whether Indian Government deserves to rule over Kashmir, then I do not think any segment of India should be the part of "India".
Oh wait, Kashmir has witnessed a significant number of extra-judicial encounters or in plain language "cold blooded murder". So let me remind you that other states in India have witnessed more extra-judicial encounters than Kashmir. Jamshedpur, my home town, probably has more fake encounters than Kashmir. I remember encounters being a daily affair when Ajay Kumar was the SP of police. Encounters reduced after that but still happen all the time. So in that vein, Jamshedpur should have seceded from India long time back.
Here are some examples:
NHRC encounter matches
So you will say these are just incidental, where is the data? If you see the NHRC report for 2003-2004 and see Annexure 13(a) on Page 305, you will see the number of "Alleged Fake Encounters" where Uttar Pradesh had 13, Andhra Pradesh had 13, Gujarat 2, Madhya Pradesh 2, Maharashtra 2, Bihar 1, and Jammu Kashmir 0. If you are going to argue that for some reasons encounters in all except Kashmir is good, then you can stop reading this article.
The need of the hour is to make the pending police reforms happen. Make police and army accountable and stop giving them blanket immunity. Reward policeman who arrest criminals and bring them to courts. Cases of extra-judicial killings should be seriously investigated. Modify the Armed Forces Act so army folks understand the risk of fake encounters when operating in civilian areas.
But then a Kashmir Secessionist will say "leave aside the encounters, look at the way people in Kashmir are treated by Indian authorities that brings shame to the Kashmiris". I guess you have not looked at the situation of the rest of India. I guess you have not looked at how different government departments function in India. How are people treated when they go to a ration shop for BPL cards, how tribals are treated in forests over which they have rights, and how you will be treated by even police on the road.
Finance minister says that the fiscal deficit is high and there is a need to cut subsidies and increase taxes on common people. This causes increase of food items which has already hit our hungry people and malnutritioned children. And then there are severe corruption that hits government revenues like Rs 60,000 crores in 2G spectrum allocation, Rs 9,000 crores in Commonwealth games and Rs 4,000 crores by illegal mining in Jharkhand under Madhu Koda government.
Because of traffic accidents, 3 people die daily in Bangalore and 4 people die in Delhi. 52% of people dying in traffic accidents in Delhi are pedestrians. Look in Bangalore how safe it is walk and then things will be clear. Traffic police can very well reduce these numbers by making pedestrian walking safe and creating over bridge/subways for crossing roads. By making sure people who jump red lights pay fines and people who do rash driving have their licenses suspended, traffic accidents can be severly brought down.
The last argument is that when Kashmir will be ruled by a different class of people namely "real Kashmiri" then the problem will be resolved. Thats what they said when they said Jharkhand will improve when a separate "Jharkhand" state will be created and I know what the current state is. Thinking that replacing "Omar Abdullah" by "Syed Gilani" will change the future of a Kashmiri is a mirage that only fools can believe in. I have seen people connected with soil and leaders of poor people like Laloo Yadav, D. Raja, Mayawati, Arjun Munda, Madhu Koda and I have seen what they have done.
So overall a lot of work needs to be done by the government to claim the moral authority to rule over India. We need to bring in the talk of those improvements that bring government transparency, accountability and efficiency of delivery of government services. And not get side tracked with with useless discussion of which class of people should rule. Think about who gets benefit ted by throwing in these discussions and it will be clear what is the value of this discussuin.
Some people are arguing that Indian Government has lost moral authority to rule over Kashmir valley and that is why Kashmir should be accepted as an independent state or become a part of Pakistan. However, if we put a bar as a high as "the moral authority" for determining whether Indian Government deserves to rule over Kashmir, then I do not think any segment of India should be the part of "India".
Oh wait, Kashmir has witnessed a significant number of extra-judicial encounters or in plain language "cold blooded murder". So let me remind you that other states in India have witnessed more extra-judicial encounters than Kashmir. Jamshedpur, my home town, probably has more fake encounters than Kashmir. I remember encounters being a daily affair when Ajay Kumar was the SP of police. Encounters reduced after that but still happen all the time. So in that vein, Jamshedpur should have seceded from India long time back.
Here are some examples:
NHRC encounter matches
So you will say these are just incidental, where is the data? If you see the NHRC report for 2003-2004 and see Annexure 13(a) on Page 305, you will see the number of "Alleged Fake Encounters" where Uttar Pradesh had 13, Andhra Pradesh had 13, Gujarat 2, Madhya Pradesh 2, Maharashtra 2, Bihar 1, and Jammu Kashmir 0. If you are going to argue that for some reasons encounters in all except Kashmir is good, then you can stop reading this article.
The need of the hour is to make the pending police reforms happen. Make police and army accountable and stop giving them blanket immunity. Reward policeman who arrest criminals and bring them to courts. Cases of extra-judicial killings should be seriously investigated. Modify the Armed Forces Act so army folks understand the risk of fake encounters when operating in civilian areas.
But then a Kashmir Secessionist will say "leave aside the encounters, look at the way people in Kashmir are treated by Indian authorities that brings shame to the Kashmiris". I guess you have not looked at the situation of the rest of India. I guess you have not looked at how different government departments function in India. How are people treated when they go to a ration shop for BPL cards, how tribals are treated in forests over which they have rights, and how you will be treated by even police on the road.
Finance minister says that the fiscal deficit is high and there is a need to cut subsidies and increase taxes on common people. This causes increase of food items which has already hit our hungry people and malnutritioned children. And then there are severe corruption that hits government revenues like Rs 60,000 crores in 2G spectrum allocation, Rs 9,000 crores in Commonwealth games and Rs 4,000 crores by illegal mining in Jharkhand under Madhu Koda government.
Because of traffic accidents, 3 people die daily in Bangalore and 4 people die in Delhi. 52% of people dying in traffic accidents in Delhi are pedestrians. Look in Bangalore how safe it is walk and then things will be clear. Traffic police can very well reduce these numbers by making pedestrian walking safe and creating over bridge/subways for crossing roads. By making sure people who jump red lights pay fines and people who do rash driving have their licenses suspended, traffic accidents can be severly brought down.
The last argument is that when Kashmir will be ruled by a different class of people namely "real Kashmiri" then the problem will be resolved. Thats what they said when they said Jharkhand will improve when a separate "Jharkhand" state will be created and I know what the current state is. Thinking that replacing "Omar Abdullah" by "Syed Gilani" will change the future of a Kashmiri is a mirage that only fools can believe in. I have seen people connected with soil and leaders of poor people like Laloo Yadav, D. Raja, Mayawati, Arjun Munda, Madhu Koda and I have seen what they have done.
So overall a lot of work needs to be done by the government to claim the moral authority to rule over India. We need to bring in the talk of those improvements that bring government transparency, accountability and efficiency of delivery of government services. And not get side tracked with with useless discussion of which class of people should rule. Think about who gets benefit ted by throwing in these discussions and it will be clear what is the value of this discussuin.
Subscribe to:
Posts (Atom)