Tuesday, April 12, 2011

Karnataka High Court: Problems with the poor quality of uploaded judgments

To Karnataka High Court,

I run a website called Indian Kanoon http://indiankanoon.org that aggregates judgments from Supreme Court as well as all high courts. It extracts text from all judgments and provides a free state-of-art search functionality.

Currently judgments provided by Karnataka High Court on the website http://www.karnatakajudiciary.kar.nic.in/ are scanned copies of printed text. The image quality is so bad that it is hard to extract any text from these judgments and are often unreadable. Considering Karnataka High Court serves a very critical role in Indian democracy and many judgments have very far reaching consequences, such technical problem has created a huge roadblock in people looking into High Court judgments.

It is not possible for people trying to search Karnataka High Court judgments by keywords as many people will need to identify cases of interest. A technology impediment makes searching almost impossible for Karnataka High Court judgments, where we know how much people today rely on search to identify relevant material.

This email is mainly to highlight the poor quality of uploaded judgments that is inhibiting a large section of people from accessing the law of the land. It would be better if judgments are uploaded in text format or the PDF files are created from text (and not from images as currently being done).

I wish and hope that this complaint will be looked into and the technical problem will be quickly solved. I would be very happy to help Karnataka High Court if it needs any technical advice in uploading the judgments.

Thanks,
Sushant Sinha.

Thursday, December 2, 2010

Unconstitutionality of barricades on public roads in layouts/apartment-complex

In Bangalore, it is very easy to spot a number of layouts where there is an entry road and other roads that connect to various buildings inside it. But you cannot enter! There is a barricade on the entry road and there are private security guards who will inquire you. The inquiry may be as simple as asking your name and purpose to displaying special cards. One question that may come to mind is whether private people can restrict access to a public road.

Typically layouts have to comply with municipal corporations rules and regulations in which roads of certain width have to be left out depending on the height of the building and other factors. Then these areas have to be given to government for building roads, drainage and other facilities. Quoting from the interview of Advocate General of Karnataka:


Is there a law that says a certain amount of land needs to be relinquished and handed over to the BDA or the BBMP for them to develop parks and other civic amenities?


A gated community is similar to a layout, except for the fact that you provide certain other facilities like security and other things. But in any layout for that matter all roads rest with the local authority. So all roads and common facilities will go to the government.

Some people were skeptical of the above point. So here is the BBMP byelaw, which says:

Section 2.40 ‘group housing’ means more than two buildings on a plot with one or more floors and with one or more dwelling units in each floor. They are connected by an access of not less than 3.5m in width, if they are not approachable directly from the road./b>

Section 12.1: The following norms shall be adopted while approving the layout plan for group housing:-

(vi) 25% of the total area be reserved for CA, parks and open spaces, subject to a minimum of 15% for parks and open space.

(viii) The area reserved for Parks and Open spaces, CA and roads (other than internal access
in each sub-divided plot) shall be handed over free of cost to the B.D.A through registered
relinquishment deed before issue of work order.


So everywhere where you see a barricade that prevents you from going into is violating Article 19(1)(d) of the Constitution. It grants every citizen of India to move freely throughout the territory of India. All these barricades are unconstitutional. In Dr. Nitin G. Khot And Others vs Station Commandant, Belgaum ... on 23 January, 1998 the army putting barricades with in the cantonment was termed unconstitutional by the Karnataka High Court.

The educated middle/upper class people who support these barricades need to do more soul searching. They may be arguing for a right to free movement in India when they move from one part of the country to other part and may sometime would even argue for ease of movement to other country. I do not know how they take away others rights to free movement so comfortably. Probably the rights of people can be purchased from the protectors/enforcers of the law of the land.

On the rationalization issue, one theory that I have is that probably these places are not in India and so the Constitution of India does not apply to them. When the Constitution does not apply, the question of Corporation rules and BDA rules does not even arise. However, I was disappointed to see the interview with Attorney General of Karnataka who says that these are actually in India and the barricades are indeed unconstitutional. Disappointment is mainly because of the fact that rights are taken away in such a big way and the rights protectors are making the usual alibi that it is not important to take any action. I would have expected a Government that is not ready to protect fundamental rights to resign. Things look different here!

Quoting from the interview:

In 2008, the BBMP issued an order stating that there is no such thing as a gated community.

Gated community is not recognised under an Act. By putting a barricade if you close it, that closure is not permissible because what is recognised is only a layout. There is no special status to a gated community. So a gated community ultimately boils down to a layout, which is enclosed by a barricade or security. You strictly can't prevent anybody from entering a gated community because that is in the form of a layout. Nobody can be prevented from entering as such. That is why probably he has said gated communities are illegal.

But if the government is saying there is no such thing as a gated community, why are they not checking those communities which have gates?

The matter vests with the corporation and BDA. They should look into it so that people should know that such a thing is not available. Or we should provide that concept. Nothing wrong in that. The only thing is, you can't claim exclusivity, because, say tomorrow the drainage facility gets affected, it's ultimately a load on the entire area. Development of an area ultimately belongs to the corporation or BDA, they'll have to look at drainage system. So you can't say the entire thing belongs to you. That is a matter that needs to be looked into.

So when builders sell plots in such gated communities, should they explicitly state that the road doesn't belong to the community exclusively?

They should. If they collect money for roads and other things, that also may not be proper. But they may do it for the development of the road. They may collect for providing common facilities. But they should make it clear that according to the building byelaw, roads and other common facilities rests with the corporation or BDA.

Citizen Matters recently reported of the case of L&T South City in JP Nagar VII Phase. The area of this complex is 34 acres. The builder has said that about 12 acres is being handed over to the BDA for development of civic amenities and that a road in that stretch is going to be thrown open to the public. Residents are fighting against this saying there was no mention of this in any of their documents at the time of purchase.

They (L&T) have to give (to BDA). He has no option but to give.

Sunday, October 3, 2010

Setting up Streaming Replication and Hot-Standby features of Postgres 9.0 on Indian Kanoon

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